I'm trying to run multiple instance of mysql 5.1.49 on ubuntu 10.10 to setup a replication/backup database. I have added following line to /etc/mysql/my.cnf
:
[mysqld2]
server-id = 2
socket = /tmp/mysql2.sock
port = 3308
pid-file = /var/lib/mysql2/mysql2.pid
datadir = /var/lib/mysql2
log-error = /var/log/mysqld2/mysql2.log
user = mysql
also I have done:
mkdir /var/lib/mysql2
chmod -R 777 /var/lib/mysql2
chown -R mysql:mysql /var/lib/mysql2
but when I run:
/usr/bin/mysql_install_db --datadir=/var/lib/mysql2 [--user=mysql]
as root or mysql user I get:
110627 17:04:17 [Warning] Can't create test file /var/lib/mysql2/david.lower-test
110627 17:04:17 [Warning] Can't create test file /var/lib/mysql2/david.lower-test
Installation of system tables failed! Examine the logs in
/var/lib/mysql2 for more information.
...
and when I run mysqld_multi --verbose --no-log start 2
I get:
110627 17:07:21 [Warning] Can't create test file /var/lib/mysql2/david.lower-test
110627 17:07:21 [Warning] Can't create test file /var/lib/mysql2/david.lower-test
110627 17:07:21 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
110627 17:07:21 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110627 17:07:21 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
Only mysql
dir is create inside /var/lib/mysql2/
.
Any idea?!
Thanks in advance.