User Tools

Site Tools


mysql

This is an old revision of the document!


backup / restore

백업

mysqldump --single-transaction --opt -u $DBUSER -p$DBPASS $DBNAME > backup.sql

복구시에는 DB와 User 생성 필요:

$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
 
mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
    -> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
 
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
 
mysql> EXIT
Bye
$ 
mysql.1249352699.txt.gz · Last modified: 2013/08/03 05:04 (external edit)