Create MySQL Database with User

From Comprofix
Revision as of 00:56, 12 July 2018 by Mmckinnon (talk | contribs) (Created page with "# Log in to the MariaDB console. If you have a password set, use the -p flag to enter a password. #: <pre> mysql -u root -p </pre> # Create a database, named "testdb" #: <pre>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. Log in to the MariaDB console. If you have a password set, use the -p flag to enter a password.
     mysql -u root -p 
  2. Create a database, named "testdb"
     create database testdb; 
  3. 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 [email protected]'localhost' identified by 'testpassword'; 
  4. Flush MariaDB privileges
     flush privileges; 

Your database will now be ready to use!