Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

How to create database on MySQL

Date: 2010-11-16 00:00:00 -0400

I have been working with MySQL databases a little bit these days.

I will write and share some small tips for the beginners the following weeks.

Today, we’ll see how to create a Database.

Get MySQL prompt

mysql -u root -p

You will be asked the root password, and then you will get access to the MySQL prompt. At the prompt run:

create database myfirstdatabase;

Now root, needs to grant permissions to other user, so the database can be manages by another user that is not root.

GRANT ALL ON myfirstdatabase.* TO user1@localhost IDENTIFIED BY "some_pass"

Thanks to Darren

FLUSH PRIVILEGES;

Ok, you can now leavy the MySQL environment,

quit

You are done.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.