Software Collections:MySQL57

From SME Server
Jump to: navigation, search




This contrib purpose is to help configuring mysql57 on SME9 using software collection.

This RPM will allow you to have 2 versions of Mysql running side by side. You will have to select the one to use in the setup of the specific application - please see "usage" below. Please note that applications and contribs like phpmyadmin etc. will as standard use the original Mysql DBM for your OS unless you change the database connection to Mysql 5.7.

Most of configuration options are explained for mysql here : MySQL are also available for mysql57 ( except innoDB options). Only difference is to prefix mysqld and mysql.init db entry by "mysql57-".

Note that default behaviour will be socket only, and if you enable networking, it will listen on 3309 locally. You then will need to open port to 3309 to access remotely. Also if you want another port you need to define mysql57-mysqld property port to whatever you want. Also remember that default mysql port is reserved to original mysql server

this RPM will allow you to have 2 versions of mysql running!!!

see also for reference: Software_Collections:MySQL

For SME9 Software collection is only available for x64 architectures.


Contrib 9:
The latest version of smeserver-mysql57 is available in the SME repository, click on the version number(s) for more information.




A description of the Redhat Software Collections can be found here and can be downloaded manually from here

To use these repos on SME please see this page

For SME 9.x 64-bit ONLY

for the rebase of Red-Hat sfotware collection :

/sbin/e-smith/db yum_repositories set centos-sclo-rh repository \
Name 'Centos - RH Software Collections' \
BaseURL '$releasever/sclo/$basearch/rh/' \
EnableGroups no \
Visible yes \
status disabled 

For the community based software collection:

/sbin/e-smith/db yum_repositories set centos-sclo-sclo repository \
Name 'Centos - RH Software Collections' \
BaseURL '$releasever/sclo/$basearch/sclo/' \
EnableGroups no \
Visible yes \
status disabled 

Be carefull some collection are available on both repo, and migh conflict : sclo-python27 and (rh/) python27.

After adding it to the database updating the configuration file is required by issuing:

signal-event yum-modify

Warning.png Warning:
You have to do the signal-event post-upgrade; signal-event reboot; or your mysql57 installation will remain in a definitive failed state. They are MANDATORY.

yum install --enablerepo=smecontribs,centos-sclo-rh smeserver-mysql57
signal-event post-upgrade ;  signal-event reboot

Warning.png Warning:
Again, If you do not issue the previous two commands and try to start the service on your own you will end with a non functional mysql server, failed in the middle of its initialization with no way to return back except by deinstalling it all and manually remove all (absolutely all) created files by the failed initialization

NB : starting from SME 9.2 and smeserver-yum-2.4.0-15.el6.sme.noarch.rpm installed you will be able to install this scl version of mysql57 simply doing the following, without enabling the rh scl repo :

yum install --enablerepo=smecontribs smeserver-mysql57
signal-event post-upgrade ;  signal-event reboot


PHP applications that are aware of sockets are few, and most typically try to connect to a port. You will have to craft a way to define the one you want to use for your particular app. Some let you put it in a variable, some will just need you to add it after the hostname or ip (localhost:3309), some will just assume 3306 and just ignore anything else.

Possible host strings (localhost can be replaced with if needed):

  • localhost:/var/lib/mysql/mysql57.sock
  • localhost;unix_socket=/var/lib/mysql/mysql57.sock
  • localhost:3309

For Wordpress adjust the DB_HOST value in the wp-config.php file accordingly.

define( 'DB_HOST', 'localhost:/var/lib/mysql/mysql57.sock' );

command line

For your convenience, aliases have been added : mysql57, mysqlshow57, mysqladmin57, mysqldump57, mysqlimport57 and mysqlbinlog57

The following will connect to database wordpress in mysql57 server, and present the mysql prompt so you can work with the database.

mysql57 wordpress

The complete path to the specific version of mysql57 server with the mysql client would be:

/opt/rh/rh-mysql57/root/usr/bin/mysql  --socket=/var/lib/mysql/mysql57.sock

or use TCP on port 3309:

/opt/rh/mysql55/root/usr/bin/mysql --protocol=TCP --port=3309

Note that using the regular 5.1 client may work, but can lead to unexpected results. Please avoid this type of command invocation:

mysql  --socket=/var/lib/mysql/mysql57.sock

Resetting the MySQL root password

To reset the password for the MySQL root account. The MySQL root user on SME Server has a random generated password which is generated during installation. You do not need to know this password to login to MySQL with root privileges on SME Server. If you might have changed the MySQL root password you can reset it like this after getting command line access as root user.

service mysql57-mysqld stop
expand-template /root/.my.cnf
expand-template /var/service/mysql57-mysqld/set.password
/opt/rh/mysql57/root/usr/libexec/mysqld --socket=/var/lib/mysql/mysql57.sock --bootstrap --user=mysql --skip-grant-tables < /var/service/mysql57-mysqld/set.password
service mysql57-mysqld start


Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-mysql57 component or use this link .

IDProductVersionStatusSummary (2 tasks)
10468SME Contribs9.3UNCONFIRMEDcannot connect db tool to mysql57 over LAN
10159SME ContribsFuturUNCONFIRMEDCan not start mysql57


Only versions released in smecontrib are listed here:

smeserver-mysql57 Changelog: SME 9 (smecontribs)
2017/04/03 Jean-Philipe Pialasse 2.0.0-11.sme
- fix pre-backup failure [SME: 10202]
2017/03/30 Jean-Philipe Pialasse 2.0.0-10.sme
- fix initialize and load table [SME: 10197]

2017/03/15 Jean-Philipe Pialasse 2.0.0-9.sme
- some more modification to allow initialization [SME: 10148]
- error log was missing stoping initialization

- tweaking log format for system time

2017/03/12 Jean-Philipe Pialasse 2.0.0-7.sme
- update run file and template paths [SME: 10148]
- r8: add link for configuration ln -s /etc/opt/rh/rh-mysql57 /opt/rh/rh-mysql57/root/etc

- update run, set.password and my.cnf for rh-mysql57
2017/03/12 Jean-Philipe Pialasse 2.0.0-6.sme
- fix wrong path /opt/rh/mysql57/ [SME: 10147]