Create MySQL Database with User
- Log in to the MariaDB console. If you have a password set, use the -p flag to enter a password.
mysql -u root -p
- Create a database, named "testdb"
create database testdb;
- Grant user "testuser", with password "testpassword" all access to the "testdb" database. Note: If you want to remotely access this database, replace localhost with your remote address.
grant all privileges on testdb.* to testuser@'localhost' identified by 'testpassword';
- Flush MariaDB privileges
Your database will now be ready to use!