Program2.0

web2.0,ajax,IT,php,java

일반적인 mysqladmin

leave a comment »

  • mysqladmin -u root -p proc stat(=processlist) –> 서버에 현재 활동중인 threads상태보기
  • mysqladmin status

    • Uptime : the MySQL server 시작된 후 현재까지 시간 (초)
    • Threads : 현재 디비서버에 연결된 유저수
    • Questions : 서버시작후 지금까지 요청된 쿼리수
    • Slow queries : –log-slow-queries[=file_name] option로 시작된 서버가 variables에 지정된long_query_time seconds시간보다 큰 쿼리시간을 가진 요청수
    • Opens : 서버가 시작된 후 현재까지 열렸던 테이블 수
    • Flush tables : flush …, refresh, and reload commands된 수
    • Open tables : 현재 열려 있는 테이블 수
    • Queries per second avg : 평균 초당 쿼리수
    • Memory in use : the mysqld code에 의해 직접 할당된 메모리 (only available when MySQL is compiled with –with-debug=full).
    • Max memory used : the mysqld code에 의해 직접 할당된 최대메모리 (only available when MySQL is compiled with –with-debug=full).
  • mysqladmin -u root -p ping –>디비서버가 살아있는지 확인
  • mysqladmin -u root -p extended-status(※mysql>show stauts)
  • mysqladmin -u root -p variables(※mysql>show valiables)
  • mysqladmin create [databasename] : Create a new database.
  • mysqladmin drop [databasename] : Delete a database and all its tables.
  • mysqladmin flush-hosts : Flush all cached hosts.
  • mysqladmin flush-logs : Flush all logs.
  • mysqladmin flush-tables : Flush all tables.
  • mysqladmin flush-privileges : Reload grant tables (same as reload).
  • mysqladmin kill [id(,id,...)] : Kill mysql threads.
  • mysqladmin password : Set a new password. Change old password to new-password.
  • mysqladmin reload : Reload grant tables.
  • mysqladmin refresh : Flush all tables and close and open logfiles.
  • mysqladmin shutdown : Take server down.
  • mysqladmin slave-start : Start slave replication thread.
  • mysqladmin slave-stop : Stop slave replication thread.
  • mysqladmin version : Get version info from server.

Written by spaceufo

August 2, 2008 at 6:37 am

Posted in MySQL, mysqladmin, server

Tagged with , ,

Leave a Reply