Mysql

From Attie's Wiki
Revision as of 10:39, 3 February 2015 by Attie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
mysql --user=$USERNAME -p
 
# backup
mysqldump --user=$USERNAME -p $DATABASE > $SQLFILE
# restore
mysql --user=$USERNAME -p $DATABASE < $SQLFILE

Useful commands

SHOW DATABASES;
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE database;
GRANT ALL PRIVILEGES ON db.* TO 'user'@'localhost' WITH GRANT OPTION;
REVOKE ALL PRIVILEGES ON *.* FROM 'user'@'localhost';
DROP DATABASE db;
DROP USER user;
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox