Difference between revisions of "Database"
Jump to navigation
Jump to search
Line 29: | Line 29: | ||
show databases; | show databases; | ||
+ | |||
use [db name]; | use [db name]; | ||
+ | |||
show tables; | show tables; | ||
+ | |||
flush privileges; | flush privileges; | ||
+ | |||
GRANT ALL ON USERDATABASE.* TO 'USERNAME'; [http://www.softwareprojects.com/resources/programming/t-how-to-restrict-mysql-user-access-to-a-single-datab-1734.html] | GRANT ALL ON USERDATABASE.* TO 'USERNAME'; [http://www.softwareprojects.com/resources/programming/t-how-to-restrict-mysql-user-access-to-a-single-datab-1734.html] | ||
Create command list for showing user grants [http://www.pythian.com/news/1165/creative-sql-how-to-easily-show-grants-for-many-users/] | Create command list for showing user grants [http://www.pythian.com/news/1165/creative-sql-how-to-easily-show-grants-for-many-users/] | ||
SELECT CONCAT("SHOW GRANTS FOR '",user,"'@'",host,"';") FROM mysql.user WHERE host!='localhost'; | SELECT CONCAT("SHOW GRANTS FOR '",user,"'@'",host,"';") FROM mysql.user WHERE host!='localhost'; | ||
+ | |||
+ | |||
+ | SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; | ||
=== Web interfaces === | === Web interfaces === |
Revision as of 13:28, 27 June 2012
MySQL
- MySQL Reference Manuals
- 4.3.1. mysqld — The MySQL Server
- 4.6.7. mysqlbinlog — Utility for Processing Binary Log Files
- 5.1.2. Server Command Options
- 5.3. MySQL Server Logs
- 6.2. The MySQL Access Privilege System
- 13.7.1.3. GRANT Syntax
- 13.7.5.17. SHOW GRANTS Syntax
- 13.7.6.2. FLUSH Syntax
- 13.8.1. DESCRIBE Syntax
- C.5.4.1. How to Reset the Root Password
Commands
show databases;
use [db name];
show tables;
flush privileges;
GRANT ALL ON USERDATABASE.* TO 'USERNAME'; [1]
Create command list for showing user grants [2]
SELECT CONCAT("SHOW GRANTS FOR '",user,"'@'",host,"';") FROM mysql.user WHERE host!='localhost';
SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
Web interfaces
Admin
Tools
- http://dbdeploy.com/
- http://davedevelopment.co.uk/2008/04/14/how-to-simple-database-migrations-with-phing-and-dbdeploy.html
https://github.com/tanin47/php_db_migrate
- http://dbug.ospinto.com/ - "PHP version of ColdFusion’s cfdump. Outputs colored and structured tabular variable information. Variable types supported are: Arrays, Classes/Objects, Database and XML Resources."