kota's memex

Community fork of the MySQL database software. I would suggest using postgres instead for any new projects, but if you're working on something which requires MySQL it's great that MariaDB exists.

create user and database

MySQL and MariaDB do not have database owners like postgres. They do have a privilege systems to allow or deny accounts certain rights.

doas su -
mariadb
MariaDB [(none)]> CREATE USER 'someuser'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> CREATE DATABASE mydb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mydb.* TO 'someuser'@'localhost';

GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';

show databases

SHOW DATABASES;

show tables

SHOW TABLES;

show columns

SHOW COLUMNS FROM tbl_name;

show users

SELECT User FROM mysql.global_priv;