Koozali.org: home of the SME Server

MySQL57 and port 3309

Offline michelandre

  • *
  • 261
  • +0/-0
MySQL57 and port 3309
« on: December 05, 2018, 09:31:18 PM »
Hi all,

I am testing mysql contribs: MySQL55 and MySQL57.

It looks like mysql55 is no more available.
https://wiki.contribs.org/Software_Collections:MySQL55

For Software Collections:MySQL57, I tried to make it to listen to port 3309 with no success.
https://wiki.contribs.org/Software_Collections:MySQL57

I think there is a typo:

Quote
or use TCP on port 3309:

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


I should be:
Quote
/opt/rh/rh-mysql57/root/usr/bin/mysql  --port=3309

If I use the later, I am still in MySQL-5.1.73

Where do I go wrong?

I also test Software Collections:MariaDB (5.5).
https://wiki.contribs.org/Software_Collections:MariaDB which is olso no more available.

I changed to RH-MariaDB102 which is working well on port 3307 or other ports but I wonder about security!

Michel-André
« Last Edit: December 10, 2018, 03:57:23 AM by michelandre »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #1 on: December 06, 2018, 02:01:33 AM »
Check the section on Usage, sockets and 127.0.0.1 vs localhost here:

https://wiki.contribs.org/Software_Collections:MySQL55

Same applies for 57 I believe.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #2 on: December 06, 2018, 02:11:10 AM »
Already read and tried long before my post...

Michel-André

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #3 on: December 06, 2018, 02:24:38 PM »
Hi all,

I am testing mysql contribs: MySQL55 and MySQL57.

It looks like mysql55 is no more available.
https://wiki.contribs.org/Software_Collections:MySQL55

What makes you say that ? Did you try it?

Here's my quick test just now.... note you MUST do an IMMEDIATE signal-event post-upgrade or you MAY run foul of https://bugs.contribs.org/show_bug.cgi?id=10160

Apart from that, and the rather annoying PHP bug, it runs as advertised (my main CRM runs on it here and now)


Code: [Select]
config show mysql55-mysqld
mysql55-mysqld=service
    LocalNetworkingOnly=no
    status=enabled

Quote
netstat -atn |grep 3307
tcp        0      0 0.0.0.0:3307                0.0.0.0:*                   LISTEN


Quote
ll /var/lib/mysql/*.sock
srwxrwxrwx 1 mysql mysql 0 Nov 21 23:53 /var/lib/mysql/mysql55.sock
srwxrwxrwx 1 mysql mysql 0 Nov 21 23:53 /var/lib/mysql/mysql.sock

Quote
[root@server ~]# mysql55
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 117
Server version: 5.5.52 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

Or this

Quote
[root@server ~]# /opt/rh/mysql55/root/usr/bin/mysql  --socket=/var/lib/mysql/mysql55.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 118
Server version: 5.5.52 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

Quote
[root@test ~]# yum --enablerepo=smecontribs,centos-sclo-rh install smeserver-mysql55
Loaded plugins: fastestmirror, post-transaction-actions, smeserver
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: rep-centos-fr.upress.io
 * remi-safe: rpms.remirepo.net
 * smeaddons: mirror.pialasse.com
 * smecontribs: mirror.pialasse.com
 * smeextras: mirror.pialasse.com
 * smeos: mirror.pialasse.com
 * smeupdates: mirror.pialasse.com
 * updates: centos.quelquesmots.fr
base                                                                                                                                                                                | 3.7 kB     00:00     
centos-sclo-rh                                                                                                                                                                      | 2.9 kB     00:00     
centos-sclo-rh/primary_db                                                                                                                                                           | 1.2 MB     00:00     
remi-safe                                                                                                                                                                           | 3.0 kB     00:00     
remi-safe/primary_db                                                                                                                                                                | 1.1 MB     00:00     
smeaddons                                                                                                                                                                           | 2.9 kB     00:00     
smecontribs                                                                                                                                                                         | 2.9 kB     00:00     
smeextras                                                                                                                                                                           | 2.9 kB     00:00     
smeos                                                                                                                                                                               | 3.1 kB     00:00     
smeupdates                                                                                                                                                                          | 2.9 kB     00:00     
updates                                                                                                                                                                             | 3.4 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package smeserver-mysql55.noarch 0:2.0.0-8.el6.sme will be installed
--> Processing Dependency: mysql55-runtime for package: smeserver-mysql55-2.0.0-8.el6.sme.noarch
--> Processing Dependency: mysql55-mysql-server for package: smeserver-mysql55-2.0.0-8.el6.sme.noarch
--> Processing Dependency: mysql55-mysql-libs for package: smeserver-mysql55-2.0.0-8.el6.sme.noarch
--> Processing Dependency: mysql55-mysql for package: smeserver-mysql55-2.0.0-8.el6.sme.noarch
--> Processing Dependency: mysql55 for package: smeserver-mysql55-2.0.0-8.el6.sme.noarch
--> Running transaction check
---> Package mysql55.x86_64 0:1.1-23.sc1.el6 will be installed
---> Package mysql55-mysql.x86_64 0:5.5.52-1.el6 will be installed
---> Package mysql55-mysql-libs.x86_64 0:5.5.52-1.el6 will be installed
---> Package mysql55-mysql-server.x86_64 0:5.5.52-1.el6 will be installed
---> Package mysql55-runtime.x86_64 0:1.1-23.sc1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================
 Package                                                 Arch                                      Version                                            Repository                                      Size
===========================================================================================================================================================================================================
Installing:
 smeserver-mysql55                                       noarch                                    2.0.0-8.el6.sme                                    smecontribs                                     31 k
Installing for dependencies:
 mysql55                                                 x86_64                                    1.1-23.sc1.el6                                     smecontribs                                    5.2 k
 mysql55-mysql                                           x86_64                                    5.5.52-1.el6                                       smecontribs                                    5.8 M
 mysql55-mysql-libs                                      x86_64                                    5.5.52-1.el6                                       smecontribs                                    219 k
 mysql55-mysql-server                                    x86_64                                    5.5.52-1.el6                                       smecontribs                                     10 M
 mysql55-runtime                                         x86_64                                    1.1-23.sc1.el6                                     smecontribs                                    1.0 M

Transaction Summary
===========================================================================================================================================================================================================
Install       6 Package(s)

Total download size: 17 M
Installed size: 78 M
Is this ok [y/N]:
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #4 on: December 07, 2018, 03:13:19 AM »
Hi ReetP,

I do not know what I did before but, this time MySQL55 is working as written in the Contrib. The only problem with this version is that it will reach "Ext. Support End" the 31st of decembrer 2018.

The solution is to try MySQL57 or MariaDB102. If I remember right, both end in 2023.

MySQL57 looks easier to adjust then MariaDB102 as it creates template fragments as does't MariaDB. But I thing (the LIBRE way) MariaDB is a better choice as it will be more advanced with its next version.

Any way, both Contribs texts need  a refresh...

Michel-André
« Last Edit: December 07, 2018, 03:16:24 AM by michelandre »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #5 on: December 07, 2018, 10:49:23 AM »
Because Mysql is released via RHEL you will probably find that like PHP, it is supported by RHEL for security patches until the distro goes EOL.

So around Dec 2020 for CentOS 6.

MariaDB should install though I have not tested.

https://wiki.contribs.org/Software_Collections:MariaDB

Please let us know if there are any changes required (I did do some small mods on the scl contrib recently and will do more if you tell me what you require....)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #6 on: December 08, 2018, 01:58:57 AM »
Hi ReetP

I tried mariadb 55 and 102

Code: [Select]
##########
########## Repository: https://www.softwarecollections.org/repos/rhscl/mariadb55/epel-6-x86_64/


/sbin/e-smith/db yum_repositories set scl-mariadb55 repository \
Name 'Centos - RH Software Collections' \
BaseURL 'https://www.softwarecollections.org/repos/rhscl/mariadb55/epel-6-x86_64/' \
EnableGroups no \
Visible yes \
status disabled

# signal-event yum-modify

# yum install  -y mariadb55-mariadb-test  --enablerepo=scl-mariadb55

##########
########## Adjust my.conf // 
# vi /opt/rh/mariadb55/root/etc/my.cnf


[mysqld]
datadir=/opt/rh/mariadb55/root/var/lib/mysql

# Comment the line below
#socket=/var/lib/mysql/mysql.sock

# Add the 2 lines below
socket=/var/lib/mysql/mariadb55.sock
port=3308
...

##########
########## TESTING #####
# cd /opt/rh/mariadb55/root/usr/share/mysql-test

# sudo -u mysql ./mysql-test-run --skip-test-list=rh-skipped-tests.list

##########
Passes all except the ones requiring: debug_sync
Example:
rpl.rpl_mdev359 'mix'                    [ skipped ]  debug_sync is not available

##########
########## To clean up afterwards, remove the created "var" subdirectory, eg
# sudo -u mysql rm -rf /opt/rh/mariadb55/root/usr/share/mysql-test/var

For the 55 and 102, I did with or without networking:
Code: [Select]
scl enable rh-mariadb102 -- '/opt/rh/rh-mariadb102/root/usr/bin/mysql_secure_installation'with the root password in:  /root/.my.cnf

When I try;
Code: [Select]
/opt/rh/mariadb55/root/usr/bin/mysql
I still end up in MySQL-5.1.73. Same with 102.

I am doing something wrong but cannot find what.

Michel-André

PS: in yum install mariadb55 --enablrepo=scl-mariadb55 there is typo in: enablrepo  = enablerepo



Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #7 on: December 08, 2018, 02:10:11 AM »
MySQL 55, 57 and MariaDB with contribs should all 'just work'.

We don't guarantee anything else :-)

I know Mysql55 works as that is what I am running via the contrib.

I'm away on business at the minute but back home Saturday night.

I'll try and take a look Sunday for you.

Give me a bit of time.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: MySQL57 and port 3309
« Reply #8 on: December 08, 2018, 09:30:12 AM »
https://wiki.contribs.org/Software_Collections:MySQL57

Clean sme9.2 vm updates as at 8 Dec

[root@sme92x64 ~]# rpm -qa smeserver-yum
smeserver-yum-2.4.0-17.el6.sme.noarch

[root@sme92x64 ~]# yum install --enablerepo=smecontribs smeserver-mysql57
signal-event post-upgrade ;  signal-event reboot

[root@sme92x64 ~]# signal-event post-upgrade; signal-event reboot

[root@sme92x64 ~]# /opt/rh/rh-mysql57/root/usr/bin/mysql  --socket=/var/lib/mysql/mysql57.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

[root@sme92x64 ~]# mysql57
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

Works for me...
--
qui scribit bis legit

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #9 on: December 08, 2018, 09:03:47 PM »
Hi TerryF,

Thank you for your precious time.

SME-9.2 is a VM, Server Only, IP: 192.168.1.11, GW: 192.168.1.1

MyQL57 installed without problem and working perfectly.

I want to use a port to access MySQL57 as I want to test Dolibarr-8.0.3 running in dolibarr i-bay. //  Collections:PHP is installed and PHP71 is set on that i-bay only. PHP72/73 are not working with this application.

I am confused a little bit (but on a higher level) about adding the port:
- Do I use a custom template fragment?
- If so, do I modify an already existing one (which one"s") or create a new one"s"?
- In a fragment, will I use port=3309?
- Do I remove "socket=/var/lib/mysql/mysql57.sock"?
- Do I remove "skip-networking" (which is used for security reasons) and/or do I use LocalNetworkingOnly=yes?
- Expand what?
- Do I set config properties like TCPPort=3309, UDPPort=3309, and access=private in mysql57-mysqld?
* I am reading a lot of things on SQL, bugs, contribs etc...

Why is there the same parameters in /etc/opt/rh/rh-mysql57/my.cnf.d/rh-mysql57-mysql-server.cnf and in /etc/opt/rh/rh-mysql57/my.cnf. Is it because one is for server and the other one for client if so, why is it under the same heading [mysqld]?

/etc/opt/rh/rh-mysql57/my.cnf.d/rh-mysql57-mysql-server.cnf   

Code: [Select]
[mysqld]
datadir=/var/opt/rh/rh-mysql57/lib/mysql                ##### 1 (different from the one below)
socket=/var/lib/mysql/mysql.sock                        ##### 2 (same as standard MyQL-5.1.73 on SME)
log-error=/var/opt/rh/rh-mysql57/log/mysql/mysqld.log   ##### 3 (different from the one below)
pid-file=/var/run/rh-mysql57-mysqld/mysqld.pid          ##### 4

/etc/opt/rh/rh-mysql57/my.cnf
Code: [Select]
[mysqld]
log-error=/var/log/mysql57-mysqld.log                    ##### 3
explicit_defaults_for_timestamp = 1
log_timestamps = SYSTEM

pid-file=/var/run/rh-mysql57-mysqld/mysqld.pid           ##### 4
basedir=/opt/rh/rh-mysql57/root/usr
datadir=/opt/rh/rh-mysql57/root/var/lib/mysql            ##### 1
lc-messages-dir=/opt/rh/rh-mysql57/root/usr/share/rh-mysql57-mysql/english/
socket=/var/lib/mysql/mysql57.sock                       ##### 2
skip-networking

On top of that, when MySQL57 will be running correctly using a port, I would like to replace it with RH-MariaDB102 and write a HowTo about it...

I have a lot on my table and I thank everyone putting their 2¢ so I will get less poor,


Michel-André

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #10 on: December 08, 2018, 09:33:42 PM »
As per the wiki it defaults to socket only.

You need modify the key to enable a port.

But you should NOT need any custom templates

See Usage here. Should be the same for 57.

https://wiki.contribs.org/Software_Collections:MySQL55

E.g

Code: [Select]
config setprop mysql55-mysqld port 3307 LocalNetworkingOnly no signal-event post-upgrade;signal-event reboot
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: MySQL57 and port 3309
« Reply #11 on: December 08, 2018, 10:07:34 PM »
[root@sme92x64 ~]# config setprop mysql57-mysqld port 3309 LocalNetworkingOnly no
[root@sme92x64 ~]# config show mysql57-mysqld
mysql57-mysqld=service
    LocalNetworkingOnly=no
    port=3309
    status=enabled

[root@sme92x64 ~]# netstat -atn |grep 3309
tcp        0      0 :::3309                     :::*                        LISTEN

[root@sme92x64 ~]# /opt/rh/rh-mysql57/root/usr/bin/mysql --protocol=TCP --port=3309
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: MySQL57 and port 3309
« Reply #12 on: December 08, 2018, 10:50:05 PM »
--
qui scribit bis legit

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #13 on: December 09, 2018, 07:08:48 AM »
Hi TerryF,

At last, it is working with MySQL57. :lol:

Tomorrow, I will describe what I did. I also have to verify security...

Thank you for your great support,

Michel-André

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: MySQL57 and port 3309
« Reply #14 on: December 09, 2018, 07:21:07 AM »
Hi TerryF,
Thank you for your great support,

ReetP taught me everything I know :-)
--
qui scribit bis legit

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #15 on: December 09, 2018, 07:24:37 AM »
Shame on me,

I also thank very much ReetP,

Michel-André

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #16 on: December 09, 2018, 12:11:57 PM »
LOLz :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #17 on: December 09, 2018, 05:19:03 PM »
Hi all,

Here is what I did to have MySQL57 working.

/etc/opt/rh/rh-mysql57/my.cnf.d/rh-mysql57-mysql-server.cnf
ORIGINAL: socket is the same as the one used by standard MySQL-5.1.73 of SME, so MYSQL57 won't start.

Code: [Select]
[mysqld]
socket=/var/lib/mysql/mysql.sock
log-error=/var/opt/rh/rh-mysql57/log/mysql/mysqld.log

MODIFIED:  Now, I can see the log in Server Manager.
Code: [Select]
[mysqld]
socket=/var/lib/mysql/rh-mysql57.sock
port=3309
log-error=/var/log/mysql57-mysqld-error.log

/etc/opt/rh/rh-mysql57/my.cnf
ORIGINAL:

Code: [Select]
skip-networking
#no port as skip-networking

MODIFIED
Code: [Select]
#### skip-networking
#no port as skip-networking
port=3309

LocalNetworkingOnly  // yes or no doesn't work, daemon won't start.

Dolibarr conf.php  //  have to use 127.0.0.1.
Code: [Select]
...
$dolibarr_main_db_host='127.0.0.1';
...
$dolibarr_main_db_port='3309';
...
$dolibarr_main_db_name='DBname';
...
$dolibarr_main_db_user='DBuser';
...
$dolibarr_main_db_pass='DBuserPWD';
...

Michel-André

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: [SOLVED] MySQL57 and port 3309
« Reply #18 on: December 09, 2018, 11:56:26 PM »
I'm not sure what on earth you are doing here.

The mysqld confs are templated.

Check this directory:

/etc/e-smith/templates/opt/rh/rh-mysql57/root/etc/my.cnf

Code: [Select]
socket=/var/lib/mysql/mysql57.sock
{
    use esmith::ConfigDB;
    my $db = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
    my $mysql57mysqld = $db->get('mysql57-mysqld') or die "not found";

    my $localonly = $mysql57mysqld->prop(LocalNetworkingOnly) || "no";
    $OUT = ($localonly eq 'yes') ? "skip-networking\n" : "# networking is enabled\n";
    # define port
    my $port = $mysql57mysqld->prop('port') || "3309";
    $OUT .= ($localonly eq 'yes') ? "#no port as skip-networking\n" : "port=$port\n";
}

So you get a socket as standard. If you set the LocalNetworking key to something other than yes you get a port too.

This is all you you should need:

Code: [Select]
config setprop mysql57-mysqld port 3309 LocalNetworkingOnly no
signal-event post-upgrade;signal-event reboot

Then check the file /opt/rh/rh-mysql57/root/etc/my.cnf for values. If it does not show a change then it is a bug and needs logging to be looked at. HOWEVER, Terry installed it and it worked.

The logging goes to the correct place which is /var/log/msql57-mysqld.log

cat 006logfile

Code: [Select]
log-error=/var/log/mysql57-mysqld.log
explicit_defaults_for_timestamp = 1
log_timestamps = SYSTEM

You clearly are not following the guide somewhere.

You are posting a load of hacks that will break stuff for users. Please, go back and follow the guide properly. If it doesn't 'just work' then you need to find out why, not just aimlessly hack about.

If needs be follow the mysql55 guide (which definitely works) and substitute 57 for 55 and 3309 for 3307.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline michelandre

  • *
  • 261
  • +0/-0
Re: MySQL57 and port 3309
« Reply #19 on: December 10, 2018, 10:13:31 PM »

Quote
I'm not sure what on earth you are doing here.

What a true paternalistic way of asking someone what he is doing instead of asking him why!
Really not the best way to encourage new collaborator!

WHY:

**** Software Collections:MySQL55

1) For the community based software collection: http://mirror.centos.org/centos/6/sclo/x86_64/sclo/
   #### Why is it included?
   #### It is just confusing.

2) Duplicate entries
   #### Lot of "Duplicate column name..." in every reboot after evey: signal-event post-upgrade ; signal-event reboot
   #### Not very reassuring...
 
3) or use TCP on port 3307:
   /opt/rh/mysql55/root/usr/bin/mysql --protocol=TCP --port=3307
   #### ERROR without the "Usage" config
   #### Constructive criticism: Confusing, should go in "Usage" section.

4) config setprop mysql55-mysqld port 3307 LocalNetworkingOnly no
   #### Constructive criticism: Should explain that it introduces a breach of security
   #### https://smeserver.pialasse.com/index.php/Mysql

5) /opt/rh/mysql55/root/etc/my.cnf
   #### Only one .cnf compare with 2 for MySQL57
   #### Why?

6) socket=/var/lib/mysql/mysql55.sock
   #### The socket is right

7) mysql55 wordpress
   #### ERROR 1049 (42000): Unknown database 'wordpress'
   #### Confusing
   #### Constructive criticism: Instead, should explain to use:
   #### define('DB_HOST', 'localhost:/var/lib/mysql/mysql55.sock');
   #### in wp-config.php


**** MySQL57


1) Reply #18
Quote
If needs be follow the mysql55 guide (which definitely works) and substitute 57 for 55 and 3309 for 3307.

Original:       /opt/rh/mysql55/root/usr/bin/mysql  --socket=/var/lib/mysql/mysql55.sock
As you suggest: /opt/rh/mysql57/root/usr/bin/mysql  --socket=/var/lib/mysql/mysql57.sock
   #### Output of that command: "-bash: /opt/rh/mysql57/root/usr/bin/mysql: Aucun fichier ou dossier de ce type"

2) First config file: /etc/opt/rh/rh-mysql57/my.cnf

   datadir=/opt/rh/rh-mysql57/root/var/lib/mysql
   ##### Different from the one in second config file

   socket=/var/lib/mysql/mysql57.sock
   #### Good socket

   log-error=/var/log/mysql55-mysqld.log
   #### Good path

   Last lines of the file
   #### Constructive criticism: Usually, the last lines should be:
      #
      # include all files from the config directory
      #
      !includedir /etc/opt/rh/rh-mysql57/my.cnf.d
   #### If MariaDB does it, why not MySQL5x ?    

3) Second config file: /etc/opt/rh/rh-mysql57/my.cnf.d/rh-mysql57-mysql-server.cnf
   #### Why it is there if it is not used?

   datadir=/var/opt/rh/rh-mysql57/lib/mysql
   ##### different from the one in first config file

   socket=/var/lib/mysql/mysql.sock/
   #### Bad socket
   #### Same socket as MySQL-5.1.73 and different from the one in first config file
 
   log-error=/var/opt/rh/rh-mysql57/log/mysql/mysqld.log
   #### Why is it different from the one in first config file?

4) Reply #18
   config setprop mysql57-mysqld port 3309 LocalNetworkingOnly no
   #### Breach of security
   #### So I tried: bind-address=127.0.0.1 with:
   config setprop mysql57-mysqld bind-address 127.0.0.1
   signal-event post-upgrade ; signal-event reboot
   #### does not show up in: /etc/opt/rh/rh-mysql57/my.cnf
   #### does not show up in: /etc/opt/rh/rh-mysql57/my.cnf.d/rh-mysql57-mysql-server.cnf
   #### How to do that to close the breach of security?

**** Software Collections:MySQL57

1) In "command line" section
   /opt/rh/mysql55/root/usr/bin/mysql --protocol=TCP --port=3309
   #### Constructive criticism:
   #### typo 1) /opt/rh/mysql55 -> /opt/rh/rh-mysql57
   #### typo 2)  mysql55 -> mysql57

2) mysql57 wordpress
   #### ERROR 1049 (42000): Unknown database 'wordpress'
   #### Again, confusing
   #### Constructive criticism: Instead, should explain to use:
   #### define('DB_HOST', 'localhost:/var/lib/mysql/mysql57.sock');
   #### in wp-config.php
   
3) or use TCP on port 3309:
   #### Constructive criticism: Confusing, should go after the section:
   #### # config setprop mysql57-mysqld port 3309 LocalNetworkingOnly no

Conclusion to the WHY:

With all that confusion, that is why I wanted to go to RH-MariaDB102

Michel-André

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: MySQL57 and port 3309
« Reply #20 on: December 11, 2018, 12:31:13 AM »
I'm sorry if you find it 'paternalistic', but bearing in mind you write, and I think sell, some documentation on SME if staggers me that you don't know more about how SME works, and that causes you to go running round doing stuff that is unnecessary because you haven't read enough or asked the right questions.

The way to install on SME is via the contribs. If you want to try other methods then you are on your own.

The guides are:

https://wiki.contribs.org/Software_Collections:MySQL55

https://wiki.contribs.org/Software_Collections:MySQL57

1. Does it work or does it not work

2. Is the wiki correct or is it not correct

Do one small thing at a time, read up around the subject including bugs, describe exactly what you did, and don't go hacking about with stuff you don't understand.


Mysql 55

Links are there for reference. As you know we like to try and document as much as possible. If we didn't include that then someone else would probably ask why not. We can't win.

Duplicate entries. As I am not sure which DB you are referring I'm not sure if this relates to mysql57 or not. Have you checked the forums/bug tracker?

Usage - yes, it could, but equally it is in 'Command line' which should be fairly obvious. You have wiki access. You are free to revise if you want to.

LocalNetworking. You aren't reading very carefully. On the main wiki page it says:

config setprop mysql55-mysqld port 3307 LocalNetworkingOnly no

This does not expose the port via the firewall so is no more insecure than the stock Mysql.

On the pialasses page it says:

config setprop mysqld TCPPort 3306 access public status enabled LocalNetworkingOnly no

Note the 'access public' bit? That will tell SME to open a port on the firewall to allow access. That isn't in the SME wiki page.

Breach of security? The only security issues you will introduce are ones of your own making. Again, if you bothered reading the wiki and understanding SME more you would understand this (or at least ask the right questions)

Here is your starter on firewalling: https://wiki.contribs.org/Firewall

If you read and digest that you will note the use of Allow/Deny hosts. Go right ahead and use them as they were designed.

Defining setups for every webapp is not practical. By all means go ahead and write a section on common usage for all the webapps out there, and whether or not they can use a socket. Personally I don't have the time to install and document them all. Do you?


Mysql57

Two templates for mysql57 my.cnf ? Because you haven't read enough to understand.

It is probably because there is a default one with the RH-SCLO rpm, but it uses different default paths to SME.
SME is NOT strict RH/CentOS and does not ALWAYS follow their conventions. There are entries in the SME contrib to configure mysql57 to run specifically on SME.
Hence playing about with stuff and making rash comments without really understanding things is not helpful. Get a SRPM. Check the code, See what it actually does.

So you then try this:
config setprop mysql57-mysqld bind-address 127.0.0.1

So where is that in the documentation? Have you checked if that is a db key? No. So you are thrashing around in the hope of solution instead of asking a sensible question (How do I limit access to the port, or How do I bind only to localhost), reading the documents, or looking a the installed templates.
Read above for 'Firewall' Then it may become obvious.

I fixed one of your typos but cannot see the other.

Webapps - as before.

I have modded the wiki pages a little. If you want to do more feel free.

I am happy to help, and indeed want to encourage, but you need to help yourself first.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation