Database
MySQL
- Wikipedia:MySQL
- InnoDB is the default storage engine for MySQL
Commands
Account management
CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass'; CREATE DATABASE [databasename];
GRANT all on userdatabase.* TO 'username'; [1]
SHOW GRANTS SHOW GRANTS FOR 'user'@'localhost';
Create command list for showing user grants [2]
SELECT CONCAT("SHOW GRANTS FOR '",user,"'@'",host,"';") FROM mysql.user WHERE host!='localhost';
FLUSH privileges;
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('mypass');
DB management
SHOW databases; USE [db name]; SHOW tables; 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 ;
13.8.1. DESCRIBE provides information about the columns in a table.
Security
Troubleshooting
- 4.6.7. mysqlbinlog — Utility for Processing Binary Log Files
SQLite
MariaDB
Web interfaces
Admin
mysqladmin create db_name
mysqldump
Tools
- dbdeploy is a Database Change Management tool.
- https://github.com/tanin47/php_db_migrate
- https://bitbucket.org/stepancheg/mysql-diff/wiki/Home
- dBug - "PHP version of ColdFusion’s cfdump. Outputs colored and structured tabular variable information. Variable types supported are: Arrays, Classes/Objects, Database and XML Resources."