D
D
Denis2015-01-11 13:28:49
MySQL
Denis, 2015-01-11 13:28:49

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/

When the daemon is started with the line
mysqld_safe --defaults-file=/etc/mysql_internet/debian.cnf The config is ignored
and the daemon does not start, swearing at the presence of a pid file.
When starting mysqld_safe --pid-file=/var/lib/mysql/mysql_internet.pid --defaults-file=/etc/mysql_internet/debian.cnf --port=3322
The daemon allegedly starts, but does not even pick up the path to the logs from config, and netstat shows nothing on port 3322.
The question is standard: CHYADNT and how to be?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
P
Puma Thailand, 2015-01-11
@opium

Discover virtualization or docker containers

E
Ergil Osin, 2015-01-11
@Ernillew

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.

V
Vlad Zhivotnev, 2015-01-11
@inkvizitor68sl

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.

I
Ilya T., 2015-01-11
@Insaned

I walk with a transporter and chant: Docker! Docker! Docker!

A
Archie Kuznetsov, 2015-01-12
@Wolf4ara

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

G
GMAX, 2016-09-03
@GMAX

Create a user who is allowed to connect to the Internet.
You can restrict both the user and the entire database by IP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question