Create Database and User in MySQL or MariaDB in shell

Last updated on April 27th, 2020 at 02:25 am

I write this because just a note or cheatsheet for me to copy and paste from here to make my life easier. Every time when migrate website from one server to one server, I need to recreate the user and database before insert back to the new host.

# mysql

CREATE DATABASE juzhax_database;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `juzhax_database` . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

Tags:

Discover more from Juzhax Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading