the purpose is to install mysql56 from the software collections, listening on the port 3307, of course the goal is to have (if you want) also the mysql51 server belong to.
yum install centos-release-scl --enablerepo=extras yum install http://mirror.de-labrusse.fr/nethserver/nethserver-rh-mysql56/nethserver-rh-mysql56-0.0.2-1.ns6.sdl.noarch.rpm
then normally the service rh-mysql56-mysqld is launched and ready to work
you have some db
[root@nethserver-dev ~]# config show rh-mysql56-mysqld rh-mysql56-mysqld=configuration LocalNetworkingOnly=no MaxAllowedPacket=16M TCPPort=3307 access=private status=enabled
you have two events when you modify the e-smith database.
if you want to work with mysql56 you must use the same command like mysql, followed by 56
[root@nethserver-dev bin]# ls -l mysql*56 -rwxr-xr-x. 1 root root 95 May 22 15:36 mysql56 -rwxr-xr-x. 1 root root 100 May 22 15:36 mysqladmin56 -rwxr-xr-x. 1 root root 102 May 22 15:36 mysqlbinlog56 -rwxr-xr-x. 1 root root 100 May 22 15:36 mysqlcheck56 -rwxr-xr-x. 1 root root 69 May 22 15:36 mysql_config_editor56 -rwxr-xr-x. 1 root root 62 May 22 15:36 mysqld_multi56 -rwxr-xr-x. 1 root root 99 May 22 15:36 mysqldump56 -rwxr-xr-x. 1 root root 61 May 22 15:36 mysqlimport56 -rwxr-xr-x. 1 root root 62 May 22 15:36 mysql_plugin56 -rwxr-xr-x. 1 root root 100 May 22 15:36 mysqlshow56 -rwxr-xr-x. 1 root root 59 May 22 15:36 mysqlslap56
therefore by example
[root@nethserver-dev bin]# mysql56 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.26 MySQL Community Server (GPL) Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
SOMETHING IMPORTANT :
With mysql we use a default socket on /var/lib/mysql/mysql.sock that it cannot be shared nor modified if we want to install also mysql51. Therefore in your web application you cannot use the ‘localhost:3307’ location which will use the default socket, you MUST use the location ‘127.0.0.1:3307’
a picture is sometime more easy to understand…this is what I mean
in order to create a mysql db (I did my tests with wordpress because it is simple to install)
mysql56 create database wordpress; grant all privileges on wordpress.* to username@localhost identified by 'password'; flush privileges; exit
mysql56 databases can be saved by the normal backup program of nethserver
- when you do ‘signal-event pre-backup-data’ the databases are saved to /var/lib/nethserver/backup/rh-mysql56/
- when you do ‘signal-event post-backup-data’ all dumped databases are removed from /var/lib/nethserver/backup/rh-mysql56/
- when you do ‘signal-event post-restore-data’ all databases are restored from the dumps.