snippets

View on GitHub

How to create new DB user + DB and assign this user to DB

Login as an administrator
sudo mysql -u root -p
Create DB, DB user and grant privileges to the DB table
CREATE USER 'test'@'localhost' IDENTIFIED BY 'TEST123!password';
CREATE DATABASE test;
GRANT ALL PRIVILEGES ON  `test`.* TO  'test'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Check
quit
mysql -u test -p
TEST123!password
use test;
show tables;