LINUX, FOSS AND LIBRARY TECHNOLOGY ENTHUSIAST

Sunday, August 30, 2020

How to create a database, user with password in MySQL/MariaDB

0 comments

Here is the step for creating a MySQL/MariaDB database with a user and password.

Step1:
Login to MySQL/MariaDB shell

sudo mysql -uroot -p

(provide root password)

create database dbname;
CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'dbuserpassword';
GRANT ALL PRIVILEGES ON *.* TO 'dbuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit;


No comments:

Post a Comment