All databases:
mysqldump --user=XXXXXXXX --password=XXXXXXX -A > /PATH/TO/DUMPFILE.SQLJust some DB:
mysqldump --user=XXXXXXXX --password=XXXXXXX --databases DB_NAME1 DB_NAME2 DB_NAME3 > /PATH/TO/DUMPFILE.SQLJust some tables:
mysqldump --user=XXXXXXXX --password=XXXXXXXX --databases DB_NAME --tables TABLE_NAME > /PATH/TO/DUMPFILE.SQL
NOTE: if you get and error saying "(...)when using LOCK TABLES" append this to the dump command:
--single-transactionRESTORE:
mysql --verbose --user=XXXXXXXX --password=XXXXXXXX DB_NAME < /PATH/TO/DUMPFILE.SQLPermissions:
GRANT ALL ON db_base.* TO db_user @'%' IDENTIFIED BY 'db_passwd';Change User password:
$ mysql -u root -p
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-PASSWORD-HERE") where User='tom';
No comments:
Post a Comment