时间:2021-07-01 10:21:17 帮助过:3人阅读
mysql -h172.168.17.67 -ufood -pfood@hongxincd2013 -e "show databases;"
mysql -h172.168.17.67 -ufood -pfood@hongxincd2013 -e "flush tables with read lock;"
mysql -h172.168.17.67 -ufood -pfood@hongxincd2013 -e "show master status;"
mysqldump -h172.168.17.67 -ufood -pfood@hongxincd2013 -e food > /opt/food-`date "+%Y-%m-%d"`.sql
mysql -h172.168.17.67 -ufood -pfood@hongxincd2013 -e "unlock tables;"
mysqldump -uroot -proot --all-databases --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=2 > changhong.sql
more mei.sql #查看log files and post site
stop slave;
mysql -uroot -proot < changhong.sql
3306
CHANGE MASTER TO MASTER_HOST=‘192.168.2.3‘,MASTER_PORT=3306,MASTER_USER=‘replication‘, MASTER_PASSWORD=‘replication‘,MASTER_LOG_FILE=‘mysql-bin.000005‘,MASTER_LOG_POS=154;
start slave
show slave status\G;
===================================================================================================
[mysqld]
port = 3306
socket = /data/mysql/mysql.sock
datadir = /data/mysql/
lower_case_table_names=1
server-id = 2
log-bin=mysql-bin
binlog_format=mixed
expire_logs_days = 10
skip-external-locking
skip-name-resolve
#skip-networking #本地调用开启,远程tcp调用关闭
key_buffer_size = 16M
max_connections = 1000
max_allowed_packet = 16M
[mysqld_safe]
pid-file=/var/run/mysqld/mysqld.pid
log_error = /data/mysql/log/mysql-error.log
slow_query_log = 1
slow_query_log_file = /data/mysql/log/mysql-slow.log
===================================================================================================
mysql操作记录
标签: