달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2008. 3. 20. 01:11

MySQL Commands DB2008. 3. 20. 01:11

my.conf 사용하기

bin/safe_mysqld --defaults-extra-file=/opt/mysql-5.0.51a-osx10.5-x86/my.cnf --user=root

사용자 추가하기

grant all privileges on *.* to userId@'ip.%' identified by 'password' with grant option; flush privileges;

리플리케이션 상태보기

Read_Master_Log_Pos와 Exec_Master_Log_Pos의 차이가 없어야 함

dump/import

  • /usr/local/mysql/bin/mysqldump --user=userId database --default-character-set=utf8 > xx.sql
  • /usr/local/mysql/bin/mysql --user=userId database [optional_table_name] < xx.sql

uptime 보기

./mysqladmin status -ppassword

커맨드 누적 횟수 보기

mysql> show status like 'Com_%';

프로세스 개수 보기

./mysqladmin -uroot processlist | wc -l
:
Posted by codetemplate