How to Create a MySQL Database

Login to the MySQL server as root:

mysql -u root -p

Create a new MySQL database:

CREATE DATABASE dbname;

Create the username and password for the database:

GRANT ALL ON dbname.* TO username@localhost IDENTIFIED BY 'password';

View all MySQL databases:

SHOW DATABASES;

More Related Posts