JosefJezek
3/3/2014 - 11:20 AM

MySQL

MySQL

MySQL

Backup

mysqldump -h $DBHOST -u $DBUSER -p$DBPASS $DBNAME > dump.sql

Restore

mysql -u root -p[root_password] [database_name] < dump.sql

mysql -D db3 -o < backup.sql

Create DB

mysql -u root -p
CREATE DATABASE wordpress;
CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL ON trac.* TO tracuser@localhost IDENTIFIED BY 'password';
GRANT ALL ON *.* TO username@"%" IDENTIFIED BY "password";
FLUSH PRIVILEGES;

Migrate from MS SQL