MYSQLD MULTI

From Edgar BV Wiki
Jump to navigation Jump to search
#/usr/bin/mysql_install_db --user=mysql --datadir=/var/lib/mysql_edgarbv

Voeg toe in my.cnf

[mysqld_multi]
mysqld     = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
log        = /var/log/mysqld_multi.log
user       = multi_admin
password   = d3nc23d

[mysqld2]	//NOTITIE na mysqld mag je alleen een oplopend getal gebruiken dus volgede is [mysqld3]
user            = mysql
pid-file        = /var/run/mysqld_edgarbv/mysql.pid
socket          = /var/run/mysqld_edgarbv/mysql.sock
port            = 3308
datadir         = /var/lib/mysql_edgarbv
server-id       = 2
tmpdir          = /tmp
#log-bin=mysql-bin
log-error=/var/log/mysqld_edgarbv.log
#skip-slave-start
skip-external-locking
#bind-address           = 127.0.0.1
#touch /var/log/mysqld_edgarbv.log
#chown -R mysql:adm /var/log/mysqld_edgarbv.log
#/etc/init.d/mysql restart
#mysqld_multi start 2
#mysqld_multi report

Reporting MySQL servers
MySQL server from group: mysqld2 is running

Of `#tail -f /var/log/mysqld_multi.log` kan je ook gebruiken

# lsof -i:3308
COMMAND   PID  USER   FD   TYPE    DEVICE SIZE NODE NAME
        mysqld  14573 mysql   12u  IPv4 123810911       TCP localhost:3308 (LISTEN)
9)	#tail -f /var/log/mysqld_edgarbv.log
120725 15:18:42 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.51a-24+lenny5-log'  socket: '/var/run/mysqld_edgarbv/mysql.sock'  port: 3308  (Debian)
#mysql -h127.0.0.1 --port=3308 -u root –p
Mysql   > show databases;
	+--------------------+
	| Database           |
	+--------------------+
	| information_schema |
	| mysql              |
	+--------------------+
	2 rows in set (0.00 sec)
Mysql > use mysql;
Mysql > use mysql; update user set password=PASSWORD("XXXXXXX") where User='root';
Mysql > GRANT SHUTDOWN ON *.* TO 'multi_admin'@'localhost' IDENTIFIED BY ' d3nc23d'
Mysql > flush privileges;
#ps ax|grep mysqld_edgarbv
23733 pts/0    R+     0:00 grep mysqld_edgarbv
29328 pts/0    S      0:00 /bin/sh /usr/bin/mysqld_safe --user=mysql --pid-file=/var/run/mysqld_edgarbv/mysql.pid --socket=/var/run/mysqld_edgarbv/mysql.sock --port=3308 --datadir=/var/lib/mysql_edgarbv --server-id=2 --tmpdir=/tmp --log-error=/var/log/mysqld_edgarbv.log --skip-external-locking
29469 pts/0    Sl     0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql_edgarbv --user=mysql --pid-file=/var/run/mysqld_edgarbv/mysql.pid --skip-external-locking --port=3308 --socket=/var/run/mysqld_edgarbv/mysql.sock --server-id=2 --tmpdir=/tmp --log-error=/var/log/mysqld_edgarbv.log --skip-external-locking

Voeg in phpmyadmin de 2e instantie toe. Let op de host moet 127.0.0.1 zijn ipv localhost.

Vergeet ook niet de juiste port aan te geven!!

#  vi /etc/phpmyadmin/config.inc.php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['port'] = '3308';

that’s it