Answer the question
In order to leave comments, you need to log in
What is the correct way to start a second copy of the mysql daemon?
Hello!
There is a server with mysql (percona), on which several databases are running, serving sites running on the same server.
For development needs, it is necessary to create a database accessible from the Internet. At the same time, there is no desire to post the main demon on the Internet. I'm trying to run a copy of the daemon according to the ancient instructions: guruadmin.ru/page/zapuskaem-neskolko-kopij-mysql-n...
I made this config:
cat /etc/mysql_internet/debian.cnf
[client]
host = localhost
port = 3322
user = debian-sys-maint
password = password
socket = /var/run/mysqld/mysqld_internet.sock
pid-file = /var/lib/mysql/mysql_internet.pid
datadir = /var/lib/mysql_internet/
log = /var/log/mysql_internet/
log-bin = /var/log/mysql_internet/
log-update = /var/log/mysql_internet/
log-isam = /var/log/mysql_internet/
bdb-logdir = /var/log/mysql_internet/
[mysql_upgrade]
host = localhost
port = 3322
user = debian-sys-maint
password = password
socket = /var/run/mysqld/mysqld_internet.sock
basedir = /usr
pid-file = /var/lib/mysql/mysql_internet.pid
datadir = /var/lib/mysql_internet/
log = /var/log/mysql_internet/
log-bin = /var/log/mysql_internet/
log-update = /var/log/mysql_internet/
log-isam = /var/log/mysql_internet/
bdb-logdir = /var/log/mysql_internet/
Answer the question
In order to leave comments, you need to log in
Take the /etc/init.d/mysql file, copy it to some /etc/init.d/mysql-second, edit the paths to the config in it and what else (like HOME=/etc/mysql, here's another edit) and start your mysql-second.
Don't worry, run it in the chute - https://debian.pro/440
There, only the port will need to be changed so that it does not try to hang itself on 3306.
Good afternoon!
On my sentos, I did the following:
- created a separate config
- ran the command: sudo mysql_install_db --user=mysql --datadir=/opt/mysql2 --defaults-file=/etc/my2.cnf
- modified files for start/ stop the demon
- the port gave 53306 and 53307 respectively :)
Now two different demons, with different bases - test and combat
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question