tmp
Wednesday, February 27, 2013
MySQL commands
### login ```bash mysql -h [hostname] -u [user] -p ``` ### show databases ``` show databases; ### select database ``` use [database_name]; ``` ### show tables ``` show tables; ``` ### quit ``` quit; ``` ## grants ### show ``` show grants for 'mysql'@'localhost'; ``` ### add ``` grant all privileges on `foo`.* to 'mysql'@'localhost' grant SELECT, CREATE on `foo`.* to 'mysql'@'localhost' grant grant option on `foo`.* to 'mysql'@'localhost' ``` ### remove ``` revoke all privileges on `foo`.* from 'mysql'@'localhost' revoke SELECT, CREATE on `foo`.* from 'mysql'@'localhost' revoke grant option on `foo`.* from 'mysql'@'localhost' ```
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)