Create a MySQL Database and User with terminal

Login mysql

mysql -u root -p

Create Database name. Example database name: wordpress

CREATE DATABASE wordpress;

Create username. Example username: wordpressuser and Password: password

CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit

Leave a Reply