Posts Tagged ‘mysql’

mysql master salve command

master端: show master status;—查看状态: show processlist; –查看slave下mysql进程信息 reset master; #慎用,将清空日志及同步position slave端: CHANGE MASTER TO MASTER_LOG_FILE=’master.000019′; show slave status; show slave logs; show processlist; reset slave; #慎用,将清空slave配置信息、日志及同步position 在从服务器上跳过错误事件 mysql>stop slave; mysql>set global sql_slave_skip_counter = n(跳过主服务器中的接下来的 n 个事件。此命令对于由语句引起的复制终止有效。仅在从服务器线程没运行的时候有效); mysql>start slave; mysql 主服务器中同步用户 必须具有 SUPER ,RELOAD,REPLICATION SLAVE 权限 当新加从服务器时,需要先在从库上 load data master; 保证和其他从库数据一致 set global sql_slave_skip_counter=n # 客户端运行,用来跳过几个事件,只有当同步进程出现错误而停止的时候才可以执行。 [...]

mysql configuration option

./configure –prefix=/usr/local/mysql –without-debug –without-bench –enable-thread-safe-client –enable-assembler –enable-profiling –with-mysqld-ldflags=-all-static –with-client-ldflags=-all-static –with-charset=latin1 –with-extra-charset=utf8,gbk –with-innodb –with-csv-storage-engine –with-federated-storage-engine –with-mysqld-user=mysql –without-embedded-server –with-server-suffix=-community –with-unix-socket-path=/usr/local/mysql/sock/mysql.sock

mysql monitor

  #crontab time 00:10 #!/bin/bash #check MySQL_Slave Status #crontab time 00:10 MYSQLPORT=`netstat -na|grep “LISTEN”|grep “3306″|awk -F[:" "]+ ‘{print $4}’` MYSQLIP=`ifconfig eth0|grep “inet addr” | awk -F[:" "]+ ‘{print $4}’` STATUS=`mysql_path -u$user -p$password -e ‘show slave status\G’` IO_env=`echo $STATUS | grep IO | awk  ‘ {print $2}’` SQL_env=`echo $STATUS | grep SQL | awk  ‘{print $2}’` [...]

试试访问速度?