Koozali.org: home of the SME Server

MySQL57 and port 3309

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,869
  • +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,869
  • +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,869
  • +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