-1

I am trying to switch between two mysql instances but don't know how to run it using MAMP. I suppose, there is mysqld_multi but I didn't find anything in the documentation.

Thanks.

Chopra
  • 571
  • 4
  • 8
  • 23

1 Answers1

0

I've used mysqld_multi in *nix environment but not in MAC. The easiest way should be to create second MySQL instance on the same machine which runs on different port.

Simply copy /etc/my.cnf file to /etc/my2.cnf

vi /etc/my2.cnf

Change MySQL port/socket, data & log directory to run secondary mysql instance.

[mysqld]
socket=/var/lib/mysql/mysql2.sock
port=3308
user=mysql
log-error=/data1/mysql/mysqld.log
..
..

[mysqld_safe]
log-error=/data1/mysql/mysqld.log
pid-file=/var/run/mysqld/mysqld2.pid

Start secondary MySQL instance with my2.cnf default file

bash-4.1$ mysqld_safe --defaults-file=/etc/my2.cnf &