mysql常用sqlおよびチューニングクエリー

1634 ワード

1、自増主キーの次の取値alter table label AUTO_を修正するINCREMENT=255; 自己増加idの現在値255 2、接続データベース100.200.159.14ポート8006ユーザーネーミングname/passwordデータベース名test_の設定database mysql -h100.200.159.14 -P8006 -uname -ppassword -D test_database –default-character-set=utf8
3、スクリーニング表の重複データ(name重複の記録を検索)
select * from user where name in (select name from user group by NAME having count(name) > 1);
4、mysqlのバージョン番号を表示する
status; またはselect version();
5、show status; すべての情報を表示
--  MySQL          (  : )

 show status like 'uptime';

-select文の実行数の表示
show [global] status like 'com_select';

-insert文の実行数の表示
show [global] status like 'com_insert';

--  update      

show [global] status like 'com_update';

--  delete      

show [global] status like 'com_delete';

--       MySQL(        )    

show status like 'connections';

--             

show status like 'threads_cached';

--            

show status like 'threads_connected';

--            

show status like 'threads_connected';

              。  Threads_created  ,      thread_cache_size 。

show status like 'threads_created';

--     (     )   

show status like 'threads_running';

--             

show status like 'table_locks_immediate';

--               。      ,       ,        ,          。

show status like 'table_locks_waited';

--        slow_launch_time     

show status like 'slow_launch_threads';

 --        long_query_time       

show status like 'slow_queries';