Mysql commands for beginners..

This will be a Quick Mysql command Reference for beginners.

0. Starting of Mysql

> mysqladmin password “new_password”

Specify a root’s password…

> mysql -u root -p

 Connect

mysql> create database [db_name];

 Create database….

mysql> create user ‘user_name’@’localhost’ identified by ‘password’;

 Create DB user….first method..

mysql> insert into user values(’localhost’,’user_name’,password(’password’),’N’,’N’,’N’,
‘N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’,’N’);

 Create DB user.second method..according to a version,may vary N’s number.

mysql> flush privileges;

mysql> grant all privileges [...]