Wednesday, July 1, 2009

Some useful Mysql Queries

Mysql query to delete a user

mysql> delete from user where user='username';
mysql> FLUSH PRIVILEGES;

Setting Privileges

grant all privileges on DB.* to 'username'@'localhost' identified by 'pass';

SET PASSWORD FOR @localhost = OLD_PASSWORD('passwd');

To see Tables:

mysql> use DB;
mysql> show tables;

To see fields

mysql> desc tablename;

To View The contents of the table

mysql> select * from ;

UPDATE Query

mysql> update ='' where ;

Eg :update wp_users set user_pass=md5('one') where user_login='cee';

No comments:

Post a Comment