mysql基本メモ[update]

作業前はとりあえずダンプ。

# mysqldump -u root -p mt_db > mt.db

適当にupdateしてみる。

mysql> select * from mt_log where log_id='1301';
+--------+---------------+-------------+--------------+-------------+--------------+
| log_id | log_author_id | log_blog_id | log_category | log_class | log_ip      |
+--------+---------------+-------------+--------------+-------------+--------------+
|   1301 |             1 |           0 | NULL         | system    | 192.168.0.5 |
+--------+---------------+-------------+--------------+-------------+--------------+

mysql> update mt_log set log_ip='192.168.0.3' where log_id='1301';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from mt_log where log_id='1301';
+--------+---------------+-------------+--------------+-------------+--------------+
| log_id | log_author_id | log_blog_id | log_category | log_class | log_ip      |
+--------+---------------+-------------+--------------+-------------+--------------+
|   1301 |             1 |           0 | NULL         | system    | 192.168.0.3 |
+--------+---------------+-------------+--------------+-------------+--------------+
1 row in set (0.00 sec)