CheatSheet MySQL
mysqldump --user=root {nombre_db} > {nombre_db}.$(date +%d%m%Y).backup
CREATE DATABASE {nombre_db} CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SELECT TABLE_NAME, TABLE_ROWS
FROM information_schema.tables
WHERE TABLE_SCHEMA = DATABASE();
SELECT User, Host, Password
FROM mysql.user
ORDER BY 1;
CREATE USER '{username}'@'{host}'
IDENTIFIED BY '{password}';
DROP USER '{username}'@'{host}';
SET PASSWORD FOR '{username}'@'{host}' = PASSWORD('{password}');
GRANT ALL PRIVILEGES ON *.* TO '{username}'@'{host}'
IDENTIFIED BY '{password}';
SHOW GRANTS FOR '{username}'@'{host}';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM '{username}'@'{host}';
FLUSH PRIVILEGES;
system clear;
SHOW VARIABLES LIKE "general_log%";
/* ON DEBUG */
SET GLOBAL general_log = 'ON';
$ tail -f /var/lib/mysql/test.log
/* OFF DEBUG */
SET GLOBAL general_log = 'OFF';
SHOW VARIABLES LIKE "general_log%";