3 月 012014
mysql 遇到的一些问题
alter table message_board_reply_sequence auto_increment=10001;
alter table message_board_sequence auto_increment=10001;
alter table room_activity_sequence auto_increment=10001;
alter table room_message_board_reply_sequence auto_increment=10001;
alter table room_message_board_sequence auto_increment=10001;
alter table room_sequence auto_increment=10001;
alter table room_topic_sequence auto_increment=10001;
alter table user_sequence auto_increment=10001;
auto_increment=10001;
alter table message_board_sequence auto_increment=10001;
alter table room_activity_sequence auto_increment=10001;
alter table room_message_board_reply_sequence auto_increment=10001;
alter table room_message_board_sequence auto_increment=10001;
alter table room_sequence auto_increment=10001;
alter table room_topic_sequence auto_increment=10001;
alter table user_sequence auto_increment=10001;
auto_increment=10001;
#######mysqld_multi stop 关闭不了数据库
1:授权
grant shutdown on *.* to ‘shutdown’@’localhost’ identified by ‘shutdown123’;
flush privileges;
flush privileges;
2:更改my.cnf的配置
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = shutdown
password = shutdown123 (对应的授权账号和密码)
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user = shutdown
password = shutdown123 (对应的授权账号和密码)
#######同步指定端口的数据库以及双数据库的配置
CHANGE MASTER TO MASTER_HOST=’192.168.0.88′,master_port=3307, MASTER_USER=’repl’, MASTER_PASSWORD=’ceshi160′, MASTER_LOG_FILE=’mysql-bin.000001′, MASTER_LOG_POS=107;
如果变成双示例记得修理my.cnf
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = shutdown
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = shutdown
password = shutdown123
修改 [mysqld1]
添加
[mysqld2]
socket = /tmp/mysql.sock2
port = 3307
pid-file = /var/lib/mysql2/hostname.pid2
datadir = /var/lib/mysql2
user = mysql
server-id = 81
binlog-do-db = shanliao_sequence
log-bin=mysql-bin
auto-increment-increment = 1
auto-increment-offset = 1
socket = /tmp/mysql.sock2
port = 3307
pid-file = /var/lib/mysql2/hostname.pid2
datadir = /var/lib/mysql2
user = mysql
server-id = 81
binlog-do-db = shanliao_sequence
log-bin=mysql-bin
auto-increment-increment = 1
auto-increment-offset = 1