2010年11月15日 星期一

mysql basic syntax

1.list all database
show databases;

2.select one database
use mysql;

3.list all tables on database
show tables;

4.create new database
create database cms;

5.delete one database
drop database cms;

6.grant one user on all database with permission
grant all on *.* for 'username'@'host' identify by 'password';
flush privileges;

7.show permisson for specifial user
show grants for 'username'@'localhost';

沒有留言:

張貼留言