Pages

Monday, August 16, 2010

How to Create Database in Mysql

How to Create Database in Mysql

Login to your mysql server through console remote shell(putty)

If you want to create a database name = mytestdb and grant permission for user = testuser with password = testpasswd
database name = mytestdb
User Name = testuser
Password  = testpasswd


#mysql -u root -p ( enter the mysql root password)
mysql> create database mytestdb;
mysql> grant all privileges on mytestdb.* to testuser@localhost identified by 'testpasswd';
mysql> FLUSH PRIVILEGES;

mysql>show databases;
mysql> exit


This will create mytestdb and enable access for testuser form localhost
If you want to connect mysql form remote server, then replace localhost with your remote server ip



Risk Involved, Apply on your risk.

No comments:

Post a Comment