I need help . mysql on port 3306 and mysql2 on port 3307.
I copied my.cnf to my2.cnf
I added the following in my2.cnf:
datadir=/var/lib/mysql2 port=3307
cp /etc/init.d/mysql /etc/init.d/mysql2
Added to line 138 in vi /etc/init.d/mysql2:
--port=*) port=echo "$arg" | sed -e 's/^[^=]*=//'
;;
edited line 215:
conf=/etc/my2.cnf
line 257 add -c flag:
parse_server_arguments $print_defaults $extra_args mysqld server mysql_server mysql.server -c/etc/my2.cnf
Add port argument to mysql_safe command on line 284:
$bindir/mysqld_safe --defaults-file=/etc/my2.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" --port="$port" --socket="$datadir"/mysql2.sock $other_args >/dev/null 2>&1 &
added the server to the start up list
chkconfig --add mysql2 chkconfig mysql2 --level 2345 on
currently when i reboot the system and check the status. I get:
[root@localhost ~]# service mysql status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
[root@localhost ~]# service mysql2 status
ERROR! MySQL is not running, but lock file (/var/lock/subsys/mysql) exists
[root@localhost ~]# service mysql2 start
Starting MySQL... SUCCESS!
[root@localhost ~]# service mysql start
Starting MySQL...... SUCCESS!
what am i doing wrong or do i need to do to get both start on boot
atuomatically? please help.
$mysqld_pid_file_path
for each server