Creating database and adding user using CLI


For Creating a MySQL database and adding a user from CLI go through the following: Go to the mysql prompt and run the following commands:

mysql -uroot -p mysql> CREATE DATABASE dbname;

mysql> GRANT ALL PRIVILEGES ON dbname.* TO user@localhost IDENTIFIED BY ‘password-goes-here’ WITH GRANT OPTION;

Where dbname will be replace with database name and user will with username which need to add.


One Response to “Creating database and adding user using CLI”

  1. thanks dude , thats owsome , great dude

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: