MariaDB – Mysql cheat sheet

Just a collection of everyday bits and pieces that you sometimes need to reference.

To install

apt install mariadb-server mariadb-client
systemctl start mariadb

To get a command prompt even, if MariaDB.

mysql

or

mariadb

To create a database and assign a user to it, note the use of the % when creating a user, if you want to lock this down to just a user from a specific host then use the IP address or FQDN.

create database database_name;
create user 'user_name'@'%' identified by password 'password';
grant all on database_name.* to 'user_name'@'%' with grant options;

1 thought on “MariaDB – Mysql cheat sheet”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s