LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 15.0+ roll to new rc.mysqld from Feb 18 2024 cannot connect to database (https://www.linuxquestions.org/questions/slackware-14/slackware-15-0-roll-to-new-rc-mysqld-from-feb-18-2024-cannot-connect-to-database-4175736653/)

rocknrobin 05-02-2024 05:29 PM

Slackware 15.0+ roll to new rc.mysqld from Feb 18 2024 cannot connect to database
 
Hell-o. I was updating some new files from slackpkg updates and one of the new ones I rolled to was /etc/rc.d/rc.mysqld.new.

Code:


root@robrutrm:/etc/rc.d# ls -l | grep rc.mysqld
-rwxr-xr-x 1 root root  2683 Jul 15  2023 rc.mysqld*
-rwxr-xr-x 1 root root  2517 Feb 18 17:20 rc.mysqld.new*
-rwxr-xr-x 1 root root  2766 Mar 27  2019 rc.mysqld.old*
-rwxr-xr-x 1 root root  2764 Mar 27  2019 rc.mysqld_bak*

When I did this I could no longer connect either to the main database or the mythtv database.

Code:


root@robrutrm:/var/log# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local server through socket '/var/run/mysql/mysql.sock' (2)

root@robrutrm:/var/log# mysql -u root -h 10.160.134.69 -p
Enter password:
ERROR 2002 (HY000): Can't connect to server on '10.160.134.69' (115)

root@robrutrm:/etc/rc.d# mysql -u mythtv -h 10.160.134.69 -p mythconverg
Enter password:
ERROR 2002 (HY000): Can't connect to server on '10.160.134.69' (115)

Of course this doesn't allow the mythtv backend to start since it cannot connect to the mythtv database.

I rolled back to the original rc.mysqld and now I can connect to the database again.

Code:


root@robrutrm:/etc/rc.d# mysql -u root  -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.11.7-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

root@robrutrm:/etc/rc.d# mysql -u mythtv -h 10.160.134.69 -p mythconverg
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.11.7-MariaDB Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mythconverg]>

And now mythtv works again.

Anybody have any ideas how the new rc.mysqld broke mariadb?

volkerdi 05-02-2024 06:05 PM

There is no new rc.mysqld. It hasn't changed since 2021, before the release of Slackware 15.0. But thanks for making me realize that rc.mysqld.new's timestamp was getting set to the current time of package installation, because I'd like to avoid that.

The file with size 2517 is the correct version since 3 years ago. I'd have to see a diff -u against the other file to have any more ideas about this.

rocknrobin 05-02-2024 06:38 PM

Thanks volkerdi for the quick response. Here is the diff -u

Code:


root@robrutrm:/etc/rc.d# diff -u rc.mysqld rc.mysqld.new
--- rc.mysqld  2023-07-15 17:29:11.379812492 -0500
+++ rc.mysqld.new      2024-02-18 17:20:51.687222690 -0600
@@ -29,10 +29,7 @@
 # To allow outside connections to the database comment out the next line.
 # If you don't need incoming network connections, then leave the line
 # uncommented to improve system security.
-# SKIP="--skip-networking"
-
-# Uncomment the next line to use Oracle's InnoDB plugin instead of the included XtraDB
-#INNODB="--ignore-builtin-innodb --plugin-load=innodb=ha_innodb.so"
+SKIP="--skip-networking"

 # Start mysqld:
 mysqld_start() {
@@ -44,7 +41,8 @@
        rm -f /var/run/mysql/mysql.pid
      fi
    fi
-    /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP $INNODB &
+
+    /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid $SKIP &
  fi
 }

@@ -68,7 +66,6 @@
  fi
 }

-
 # Restart mysqld:
 mysqld_restart() {
  mysqld_stop

The file with size 2517 is the one that does not work. I am definitely not a developer but I see the skip-networking is enabled on the .new and the start script is somewhat different, but not much else.

volkerdi 05-02-2024 07:05 PM

There's really not been significant change to that file since Slackware 13.37 or earlier.

That said, I think you need to comment out the SKIP= line in the new file, and then it should work.

rocknrobin 05-02-2024 10:06 PM

Okay, I rolled the rc.mysqld.new file to rc.mysqld, the 2517 size file, commented out the SKIP= line, and that did the trick. Once mysqld was stopped and restarted I was able to connect to the database and mythtv launched okay. Thanks for the assistance.

rocknrobin 05-04-2024 04:21 PM

Just an FYI...after slackware updates this weekend a new /etc/rc.d/rc.mysqld.new file was added and it still has the SKIP= uncommented which as seen before causes issues with connected to the MariaDB. Should that be changed or something re-configured with the --skip-networking algorithm.

Petri Kaukasoina 05-05-2024 05:10 AM

Quote:

Originally Posted by rocknrobin (Post 6499869)
Just an FYI...after slackware updates this weekend a new /etc/rc.d/rc.mysqld.new file was added and it still has the SKIP= uncommented which as seen before causes issues with connected to the MariaDB.

That's how it works. In case of many config files, your changes are protected this way. If you make a change to the file, the next mariadb upgrade does not write the default file over your version but adds the .new file for you to consider.
Code:

# To allow outside connections to the database comment out the next line.
# If you don't need incoming network connections, then leave the line
# uncommented to improve system security.
SKIP="--skip-networking"


rocknrobin 05-05-2024 06:16 PM

Ok. Thanks.


All times are GMT -5. The time now is 06:16 AM.