Backup MySQL Database into a File


-bash-3.2$mysqldump -ujhondoe -p mydb_name > mydb_name_backup.sql
password:
-bash-3.2$ zip mydb_name_backup.zip mydb_name_backup.sql

Load MySQL Backup Into Database


-bash-3.2$mysql -ujhondoe mydb_name < mydb_name_backup.sql password:

Create User in MySQL


mysql> CREATE USER 'jhondoe'@'localhost' IDENTIFIED BY 'mypassword';
mysql> GRANT ALL PRIVILEGES ON mydbname.* TO 'jhondoe'@'localhost' WITH GRANT OPTION;

mysql> CREATE USER 'jhondoe'@'%' IDENTIFIED BY 'mypassword';
mysql> GRANT ALL PRIVILEGES ON mydbname.* TO 'monty'@'%' WITH GRANT OPTION;

Comments are closed.

Post Navigation