【まとめ】mysql常用操作【grant、show】

1093 ワード

1.すべての権限を持つアカウントを作成する
mysql>grant all privileges on *.* to    @'localhost' identified by '  ';
mysql>flush privileges;
詳細のリンクを見ることをオススメします。
http://www.cnblogs.com/hcbin/archive/2010/04/23/1718379.html
 
 
2.最大接続数、応答の最大接続数
(理想的な設定:Maxuusedictions/maxconnections*100%≒85%)
//      
mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 151   |
+-----------------+-------+
1 row in set (0.00 sec)

//          
mysql> show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| Max_used_connections | 152   |
+----------------------+-------+
1 row in set (0.00 sec)