Line 568: |
Line 568: |
| | | |
| ===Other useful MySQL commands:=== | | ===Other useful MySQL commands:=== |
| + | * list all available database. |
| show databases; | | show databases; |
− | list all available database. | + | *display a list of the MySQL users |
| SELECT user FROM mysql.user; | | SELECT user FROM mysql.user; |
− | display a list of the MySQL users
| + | *remove the user jeffrey |
| DROP USER 'jeffrey'@'localhost'; | | DROP USER 'jeffrey'@'localhost'; |
− | remove the user jeffrey
| + | * list the privileges granted to the account user |
| SHOW GRANTS FOR 'user'@'localhost'; | | SHOW GRANTS FOR 'user'@'localhost'; |
− | list the privileges granted to the account user
| + | * give all rights on all databases for new_dba user |
| GRANT ALL PRIVILEGES ON *.* TO 'new_dba'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; | | GRANT ALL PRIVILEGES ON *.* TO 'new_dba'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; |
| FLUSH PRIVILEGES; | | FLUSH PRIVILEGES; |
− | give all rights on all databases for new_dba user | + | * give all rights on database for new_user |
| GRANT SELECT, UPDATE, INSERT, DELETE ON database.* TO 'new_user'@'localhost' IDENTIFIED BY 'password'; | | GRANT SELECT, UPDATE, INSERT, DELETE ON database.* TO 'new_user'@'localhost' IDENTIFIED BY 'password'; |
| FLUSH PRIVILEGES; | | FLUSH PRIVILEGES; |
− | give all rights on database for new_user
| + | * will let you destroy a database. Use with care. Use 'mysqladmin --help' for all available options. |
| mysqladmin drop '''databasename'''; | | mysqladmin drop '''databasename'''; |
− | will let you destroy a database. Use with care. Use 'mysqladmin --help' for all available options.
| + | * show you all '''table''' details of mysql '''database''' |
| use database; | | use database; |
| show table status; | | show table status; |
− | show you all '''table''' details of mysql '''database'''
| + | * let you see all '''tables''' of mysql '''database''' |
| use database; | | use database; |
| show table status; | | show table status; |
− | let you see all '''tables''' of mysql '''database'''
| |
| | | |
| ==Password== | | ==Password== |