Difference between revisions of "Software Collections:MySQL55"

From SME Server
Jump to navigation Jump to search
 
(28 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This page purpose is to help configuring mysql55 on SME8.
+
<blockquote style="float: right;">
 +
[[File:softwarecollections.png|100px]]
 +
</blockquote>
 +
<blockquote style="float: right;">
 +
[[File:Mysql.png]]
 +
</blockquote>
 +
__TOC__
 +
== Description ==
  
most of configuration options explained for mysql here : http:wiki.contribs.org/MySQL are also available for mysql55 ( except innoDB options). Only difference is to prefix mysqld and mysql.init db entry by "mysql55-".
+
This contrib purpose is to help configuring mysql55 on SME8 and SME9 using software collection.
  
Note that default behaviour will be socket only, and if you enable networking, it will listen on 3307 locally. You then will need to open port to 3307 to access remotly. Also if you want another port you need to define mysql55-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 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.5.
 +
 
 +
Most of configuration options are explained for mysql here : [[MySQL]] are also available for mysql55 ( except innoDB options). Only difference is to prefix mysqld and mysql.init db entry by "mysql55-".
 +
 
 +
Note that default behaviour will be socket only, and if you enable networking, it will listen on 3307 locally. You then will need to open port to 3307 to access remotely. Also if you want another port you need to define mysql55-mysqld property port to whatever you want. Also remember that default mysql port is reserved to original mysql server  
 +
 
 +
See also for reference: [[Software_Collections:MySQL]]
 +
 
 +
For SME9 Software collection is only available for x64 architectures.
  
this RPM will allow you to have 2 versions of mysql running!!!
 
see also for reference: [Software_Collections:MySQL] and [MySQL55]
 
 
=== Version ===
 
=== Version ===
{{ #smeversion: smeserver-mysql55}}
+
{{#smeversion: smeserver-mysql55}}
{{ #smeversion: mysql55}}
 
 
 
  
 
=== Maintainer ===
 
=== Maintainer ===
[mailto:tests@pialasse.com[[User:Unnilennium|Unnilennium]]]
+
[mailto:tests@pialasse.com][[User:Unnilennium|Unnilennium]]
  
 
==Installation==
 
==Installation==
 +
for SME8
 +
yum --enablerepo=smecontribs install smeserver-mysql55
 +
signal-event post-upgrade
 +
signal-event reboot
  
  yum --enablerepo=smecontribs smeserver-mysql55
+
for SME9
 +
{{:Software_Collections_Repositories|transcludesection=SME9}}
 +
  yum --enablerepo=smecontribs,centos-sclo-rh install smeserver-mysql55
 
  signal-event post-upgrade
 
  signal-event post-upgrade
 
  signal-event reboot
 
  signal-event reboot
  
== Use in phpmyadmin==
+
== Command line ==
this way you will be avle to access both installation of mysql with your phpmyadmin contrib.
+
For your convenience, aliases have been added :  mysql55, mysqlshow55, mysqladmin55, mysqldump55, mysqlimport55 and mysqlbinlog55
 +
 
 +
Assuming you have a wordpress database setup, the following will connect to database wordpress in mysql55 server, and present the mysql prompt so you can work with the database.
 +
 
 +
mysql55 wordpress
 +
 
 +
However the full command line to access, per instance to mysql55 server with the mysql client against its version would be :
 +
 
 +
mysql55
 +
 
 +
Alternatively:
 +
 
 +
If you need to work with this version of MySql on the command line you will have to specify the right socket.
 +
 
 +
/opt/rh/mysql55/root/usr/bin/mysql --socket=/var/lib/mysql/mysql55.sock
 +
 
 +
or use TCP on port 3307:
 +
 
 +
/opt/rh/mysql55/root/usr/bin/mysql --protocol=TCP --port=3307
  
 +
Note that using the regular 5.1 client may work, but can lead to unexpected results:
 +
mysql  --socket=/var/lib/mysql/mysql55.sock
  
mkdir --parent /etc/e-smith/templates-custom/etc/phpMyAdmin/config.inc.php/
+
== Usage ==
  
then
+
By default mysql55 uses a socket for connections.
vim /etc/e-smith/templates-custom/etc/phpMyAdmin/config.inc.php/11config
 
  
and paste this :
+
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.
/* Server MYSQL55 localhost (config:root) [1] */
 
$i++;
 
$cfg['Servers'][$i]['host'] = 'localhost';
 
$cfg['Servers'][$i]['extension'] = 'mysql';
 
$cfg['Servers'][$i]['connect_type'] = 'socket';
 
$cfg['Servers'][$i]['socket'] = '/var/lib/mysql/mysql55.sock';
 
$cfg['Servers'][$i]['compress'] = false;
 
# standalone or login mode
 
$scriptname=end(explode('/',$_SERVER['PHP_SELF']));
 
$scriptpath=str_replace($scriptname,"",$_SERVER['PHP_SELF']);
 
# standalone login part
 
{
 
my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled');
 
my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled');
 
if (("$adminaccess" eq "enabled"))
 
  {
 
  $OUT .="if (\$scriptpath==\"/phpmyadmin/\" && \$_SERVER['PHP_AUTH_USER']=='admin')\n";
 
  $OUT .="{\n";
 
  $OUT .="\$cfg['Servers'][\$i]['auth_type'] = 'config';\n";
 
  $OUT .="\$cfg['Servers'][\$i]['user'] = 'root';\n";
 
  open (PW, "/etc/openldap/ldap.pw")
 
        || die "Could not read LDAP password.\n";
 
  my $pw = <PW>;
 
  chomp ($pw);
 
  close PW;
 
  $OUT .="\$cfg['Servers'][\$i]['password']  = '$pw';\n";
 
  $OUT .="}";
 
  }
 
else
 
  {
 
  $OUT .="# standelaone admin configuration disabled";
 
  }
 
}
 
# end of  standalone login part
 
# multiuser login part
 
{
 
my $adminaccess = ($phpmyadmin{'adminaccess'} || 'enabled');
 
my $multiaccess = ($phpmyadmin{'multiaccess'} || 'disabled');
 
  $OUT .="\n";
 
if (("$multiaccess" eq "enabled") && ("$adminaccess" eq "enabled"))
 
  {
 
  $OUT .="if (\$scriptpath==\"/phpmyadmin-multi/\")\n";
 
  $OUT .="{\n";
 
  }
 
if (("$multiaccess" eq "enabled"))
 
  {
 
  $OUT .="\$cfg['Servers'][\$i]['auth_type'] = 'cookie';\n";
 
  my $secret = ${'httpd-admin'}{TKTAuthSecret} || "34322500-7330-4400-423A-3A00434F5245";
 
  $OUT .="\$cfg['blowfish_secret'] = '$secret';\n";
 
  }
 
else
 
  {
 
  $OUT .="# multiuser disabled\n";
 
  }
 
if (("$multiaccess" eq "enabled") && ("$adminaccess" eq "enabled"))
 
  {
 
  $OUT .="}\n";
 
  }
 
}
 
# end of multiuser login part
 
$cfg['Servers'][$i]['controluser']  = "";
 
$cfg['Servers'][$i]['controlpass']  = "";
 
$cfg['Servers'][$i]['only_db']      = "";
 
$cfg['Servers'][$i]['hide_db']      = "";
 
$cfg['Servers'][$i]['verbose']      = 'Mysql55';// here is the name as it appears in phpmyadmin
 
$cfg['Servers'][$i]['pmadb']        = "";
 
$cfg['Servers'][$i]['bookmarktable'] = "";
 
$cfg['Servers'][$i]['relation']      = "";
 
$cfg['Servers'][$i]['table_info']    = "";
 
$cfg['Servers'][$i]['table_coords']  = "";
 
$cfg['Servers'][$i]['pdf_pages']    = "";
 
$cfg['Servers'][$i]['column_info']  = "";
 
$cfg['Servers'][$i]['history']      = "";
 
$cfg['Servers'][$i]['verbose_check'] = TRUE;
 
$cfg['Servers'][$i]['AllowRoot']    = TRUE;
 
$cfg['Servers'][$i]['AllowDeny']['order']="";
 
$cfg['Servers'][$i]['AllowDeny']['rules']= array();
 
$cfg['Servers'][$i]['AllowNoPassword']= FALSE;
 
$cfg['Servers'][$i]['designer_coords']= ""; 
 
$cfg['Servers'][$i]['bs_garbage_threshold']= 50; 
 
$cfg['Servers'][$i]['bs_repository_threshold']= '32M';
 
$cfg['Servers'][$i]['bs_temp_blob_timeout']= 600; 
 
$cfg['Servers'][$i]['bs_temp_log_threshold']= '32M';
 
  
 +
* localhost:/var/lib/mysql/mysql55.sock
 +
* localhost;unix_socket=/var/lib/mysql/mysql55.sock
  
 +
PHP applications that are aware of sockets are few, and most of them will try to connect to a port. To enable mysql55 to use a port you will need to do the following:
  
after just do  
+
config setprop mysql55-mysqld port 3307 LocalNetworkingOnly no
 +
signal-event post-upgrade;signal-event reboot
 +
 
 +
mysq55 should now be listening on port 3307. you can check this using netstat:
 +
 
 +
netstat -atn |grep 3307
 +
 
 +
Beware that some applications just assume the running port number, so to connect to mysql55 on 3307 instead of stock mysql on 3306 you will need to carefully investigate and modify your application accordingly e.g.
 +
 
 +
* localhost:3307
 +
 
 +
{{Warning box|1=Note that you may experience issues with PHP connecting to the correct port if you use localhost. There is an obscure bug in PHP which means you will need to use 127.0.0.1 instead of localhost. Please see See bug https://bugs.contribs.org/show_bug.cgi?id=10616 for more information}}
 +
 
 +
For Wordpress adjust the DB_HOST value in the wp-config.php file accordingly.
 +
 
 +
define( 'DB_HOST', 'localhost:/var/lib/mysql/mysql55.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 mysql55-mysqld stop
 +
expand-template /root/.my.cnf
 +
expand-template /var/service/mysql55-mysqld/set.password
 +
/opt/rh/mysql55/root/usr/libexec/mysqld --socket=/var/lib/mysql/mysql55.sock --bootstrap --user=mysql --skip-grant-tables < /var/service/mysql55-mysqld/set.password
 +
service mysql55-mysqld start
  
expand-template /etc/phpMyAdmin/config.inc.php
 
  
 
=== Bugs ===
 
=== Bugs ===
 
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
 
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
and select the smeserver-madsonic component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-madsonic|title=this link}}.
+
and select the smeserver-mysql55 component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-mysql55|title=this link}}.
  
  
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-madsonic|noresultsmessage="No open bugs found."}}
+
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-mysql55|noresultsmessage="No open bugs found."}}
  
 
===Changelog===
 
===Changelog===
Line 132: Line 111:
  
 
Only versions released in smecontrib are listed here:  
 
Only versions released in smecontrib are listed here:  
{{ #smechangelog: smeserver-madsonic}}
+
{{#smechangelog: smeserver-mysql55}}
 
 
  
[[Category: Contrib]]
+
[[Category: Deprecated Contrib]]
 
[[Category: Software Collections]]
 
[[Category: Software Collections]]

Latest revision as of 06:53, 18 April 2021

Softwarecollections.png

Mysql.png

Description

This contrib purpose is to help configuring mysql55 on SME8 and 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.5.

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

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

See also for reference: Software_Collections:MySQL

For SME9 Software collection is only available for x64 architectures.

Version

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


Maintainer

[1]Unnilennium

Installation

for SME8

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

for SME9


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 http://wiki.contribs.org/PHP_Software_Collections

For SME 9.x 64-bit ONLY

for the rebase of Red-Hat sfotware collection : http://mirror.centos.org/centos/6/sclo/x86_64/rh/

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

For the community based software collection: http://mirror.centos.org/centos/6/sclo/x86_64/sclo/

/sbin/e-smith/db yum_repositories set centos-sclo-sclo repository \
Name 'Centos - RH Software Collections' \
BaseURL 'http://mirror.centos.org/centos/$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


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

Command line

For your convenience, aliases have been added : mysql55, mysqlshow55, mysqladmin55, mysqldump55, mysqlimport55 and mysqlbinlog55

Assuming you have a wordpress database setup, the following will connect to database wordpress in mysql55 server, and present the mysql prompt so you can work with the database.

mysql55 wordpress

However the full command line to access, per instance to mysql55 server with the mysql client against its version would be :

mysql55

Alternatively:

If you need to work with this version of MySql on the command line you will have to specify the right socket.

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

or use TCP on port 3307:

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

Note that using the regular 5.1 client may work, but can lead to unexpected results:

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

Usage

By default mysql55 uses a socket for connections.

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.

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

PHP applications that are aware of sockets are few, and most of them will try to connect to a port. To enable mysql55 to use a port you will need to do the following:

config setprop mysql55-mysqld port 3307 LocalNetworkingOnly no
signal-event post-upgrade;signal-event reboot

mysq55 should now be listening on port 3307. you can check this using netstat:

netstat -atn |grep 3307

Beware that some applications just assume the running port number, so to connect to mysql55 on 3307 instead of stock mysql on 3306 you will need to carefully investigate and modify your application accordingly e.g.

  • localhost:3307


  Warning:
Note that you may experience issues with PHP connecting to the correct port if you use localhost. There is an obscure bug in PHP which means you will need to use 127.0.0.1 instead of localhost. Please see See bug https://bugs.contribs.org/show_bug.cgi?id=10616 for more information


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

define( 'DB_HOST', 'localhost:/var/lib/mysql/mysql55.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 mysql55-mysqld stop
expand-template /root/.my.cnf
expand-template /var/service/mysql55-mysqld/set.password
/opt/rh/mysql55/root/usr/libexec/mysqld --socket=/var/lib/mysql/mysql55.sock --bootstrap --user=mysql --skip-grant-tables < /var/service/mysql55-mysqld/set.password
service mysql55-mysqld start


Bugs

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


"No open bugs found."

Changelog

Only versions released in smecontrib are listed here: