かぴぶろぐ

またかぴったかと思った・・・(´A`;)

Mysql コマンド

カテゴリ[ Mysql ]
show processlist実行中のスレッドを表示
mysql> show processlist;
+-----+------+-----------+---------+---------+------+------------------+------------------+
| Id  | User | Host      | db      | Command | Time | State            | Info             |
+-----+------+-----------+---------+---------+------+------------------+------------------+
| 217 | root | localhost | kapi_jp | Connect | 1023 | Reading from net | NULL             |
| 218 | root | localhost | rdblog  | Connect | 1022 | Reading from net | NULL             |
| 219 | root | localhost | kapi_jp | Sleep   |  566 |                  | NULL             |
| 221 | root | localhost | rdblog  | Connect |  550 | Reading from net | NULL             |
| 222 | root | localhost | kapi_jp | Query   |    0 | NULL             | show processlist |
+-----+------+-----------+---------+---------+------+------------------+------------------+
5 rows in set (0.00 sec)
desc table.columnいちいち長い show columns from table名としなくても、desc column名で見れる。
mysql> desc rss_log;
+-------------+---------------------+------+-----+---------------------+----------------+
| Field       | Type                | Null | Key | Default             | Extra          |
+-------------+---------------------+------+-----+---------------------+----------------+
| id          | bigint(20) unsigned |      | PRI | NULL                | auto_increment |
| site_id     | int(11)             |      |     | 0                   |                |
| title       | text                |      |     |                     |                |
| link        | text                |      | MUL |                     |                |
| value       | text                |      |     |                     |                |
| attention   | int(11)             | YES  |     | 0                   |                |
| status      | int(11)             | YES  |     | 0                   |                |
| updated     | datetime            |      |     | 0000-00-00 00:00:00 |                |
| create_date | datetime            |      |     | 0000-00-00 00:00:00 |                |
+-------------+---------------------+------+-----+---------------------+----------------+
Userパスワードの変更
set password for [user]@[host] = password('[password]')
ログイン中のユーザーのpasswordを変更するには
mysql> set password = password('[password]');
select benchmark負荷テスト
mysql> select benchmark(100000000, 1+1);
+---------------------------+
| benchmark(100000000, 1+1) |
+---------------------------+
|                         0 |
+---------------------------+
1 row in set (2.24 sec)

http://kapi.jp/kapi_blog/106

2008年01月15日

関連カテゴリ Mysql

この記事のコメント

この記事にコメントする