805.570.3561 c

Creating a Mysql db on Ubuntu

Tuesday, Dec 09, 2008 at 01:30 PM | Solutions

To create a mysql db on ubuntu, ssh into your server and enter mysql by typing:

mysql -u root -p

Enter your password.

You should be in the mysql prompt now.

Create the db by:

CREATE DATABASE db_name;

Create the user for the db:

CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'newpassword';
FLUSH PRIVILEGES;

Grant the user privileges by:

GRANT ALL PRIVILEGES ON `db_name` . * TO 'db_user'@'localhost';
FLUSH PRIVILEGES;