[root@slave01 tmp]# ps aux |grep mysq*
root 2948 0.0 0.2 4632 1240 S 11:11 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/slave01.pid
mysql 3223 0.0 6.4 330116 33060 Sl 11:11 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/slave01.err --pid-file=/usr/local/mysql/data/slave01.pid --socket=/tmp/mysql.sock --port=3306
root 5373 0.0 0.1 4008 672 pts/1 R+ 11:20 0:00 grep mysq*
[root@slave01 tmp]# kill 2948
[root@slave01 tmp]# kill 3223
我们kill掉相关进程,再次多次启动完全OK,没有再次报错。
[root@slave01 tmp]# kill 2948
[root@slave01 tmp]# kill 3223
[root@slave01 tmp]# service mysqld restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.. [ OK ]
[root@slave01 tmp]# service mysqld restart
Shutting down MySQL. [ OK ]
Starting MySQL.. [ OK ]
[root@slave01 tmp]#
我们再次看错误日志的启动情况,可以我们这次启动已经分配到相关的主进程,好io进程,我们的主从复制情况也可以在日志中得以看到。哈哈
121206 11:25:20 mysqld_safe mysqld from pid file /usr/local/mysql/data/slave01.pid ended
121206 11:25:21 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
121206 11:25:21 InnoDB: The InnoDB memory heap is disabled
121206 11:25:21 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
121206 11:25:21 InnoDB: Compressed tables use zlib 1.2.3
121206 11:25:21 InnoDB: Initializing buffer pool, size = 16.0M
121206 11:25:21 InnoDB: Completed initialization of buffer pool
121206 11:25:21 InnoDB: highest supported file format is Barracuda.
121206 11:25:21 InnoDB: Waiting for the background threads to start
121206 11:25:22 InnoDB: 1.1.7 started; log sequence number 1595675
121206 11:25:22 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=slave01-relay-bin' to avoid this problem.
121206 11:25:22 [Note] Event Scheduler: Loaded 0 events
121206 11:25:22 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.13-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
121206 11:25:22 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000021' at position 107, relay log './slave01-relay-bin.000023' position: 253
121206 11:25:22 [Note] Slave I/O thread: connected to master 'backup@192.168.0.40:3306',replication started in log 'mysql-bin.000021' at position 107
[root@slave01 data]
总结:遇到相关错误要多看相关的错误日志提醒的说明,多理解其意图思路。