mysql
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mysql [2009/08/04 02:31] – suapapa | mysql [2013/08/03 05:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== python mysql ====== | ||
+ | <code python> | ||
+ | import MySQLdb | ||
+ | db = MySQLdb.connect(db=' | ||
+ | #cursor = db.cursor() | ||
+ | cursor = db.cursor(MySQLdb.cursors.DictCursor) | ||
+ | # | ||
+ | cursor.description # | ||
+ | postCnt = cursor.execute(' | ||
+ | </ | ||
+ | |||
+ | <img src="/ | ||
+ | |||
+ | ===== references ===== | ||
+ | *[[http:// | ||
+ | |||
====== backup / restore ====== | ====== backup / restore ====== | ||
백업 | 백업 | ||
Line 14: | Line 30: | ||
mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
mysql> EXIT | mysql> EXIT | ||
+ | </ | ||
+ | 모든 테이블 지우기 | ||
+ | <code mysql> | ||
+ | mysqldump --single-transaction -uID -pPASS --add-drop-table --no-data DB_NAME \ | ||
+ | | grep ^DROP \ | ||
+ | | mysql -uID -pPASS DB_NAME | ||
</ | </ | ||
+ | ====== blog restore ====== | ||
+ | <code mysql> | ||
+ | mysql> select option_name, | ||
+ | +-------------+----------------------------------+ | ||
+ | | option_name | option_value | ||
+ | +-------------+----------------------------------+ | ||
+ | | siteurl | ||
+ | +-------------+----------------------------------+ | ||
+ | 1 row in set (0.00 sec) | ||
+ | |||
+ | mysql> update wp_options set option_value=' | ||
+ | Query OK, 1 row affected (0.00 sec) | ||
+ | Rows matched: 1 Changed: 1 Warnings: 0 | ||
+ | |||
+ | mysql> select option_name, | ||
+ | +-------------+---------------------------------------+ | ||
+ | | option_name | option_value | ||
+ | +-------------+---------------------------------------+ | ||
+ | | siteurl | ||
+ | +-------------+---------------------------------------+ | ||
+ | 1 row in set (0.00 sec) | ||
+ | |||
+ | </ |
mysql.1249353072.txt.gz · Last modified: 2013/08/03 05:04 (external edit)