LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   tomcat fails to connect with mysql after upgrading to Slackware 14.2 (https://www.linuxquestions.org/questions/linux-server-73/tomcat-fails-to-connect-with-mysql-after-upgrading-to-slackware-14-2-a-4175599901/)

mfoley 02-16-2017 09:25 AM

tomcat fails to connect with mysql after upgrading to Slackware 14.2
 
I've just upgraded my OS from Slackware 14.1 to 14.2. After doing so, my jsp/tomcat programs can no longer connect to mysql. I get the error:
Quote:

Status 0, Communications link failure. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
I am running java 1.8.0_25, tomcat 8.5.11, tomcat-connector for mysql 1.2.40

current mysql version: 15.1 Distrib 10.0.29-MariaDB
previous mysql Ver 15.1 Distrib 5.5.40-MariaDB

my java driver string is "com.mysql.jdbc.Driver", and my connection string/URL is "jdbc:mysql://localhost/members?user=user&password=password"

I cannot telnet to port 3306.

I can do queries from the command line, no problem.

I have errors in /var/lib/mysql/hostname.err (partial):
Code:

170216  9:52:02 [ERROR] Native table 'performance_schema'.'users' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'accounts' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'hosts' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'socket_instances' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'socket_summary_by_instance' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'socket_summary_by_event_name' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'session_connect_attrs' has the wrong structure
170216  9:52:02 [ERROR] Native table 'performance_schema'.'session_account_connect_attrs' has the wrong structure
170216  9:52:02 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1146: Table 'mysql.gtid_slave_pos' doesn't exist
170216  9:52:02 [Note] /usr/libexec/mysqld: ready for connections.

I've tried various suggestion I've found search the web, but none work.

Any ideas?

bathory 02-17-2017 02:21 AM

Quote:

I cannot telnet to port 3306.
I guess you should check if mysql/mariadb is running with the "--skip-networking" option and/or that you have opened port 3306 in your firewall

Regards

mfoley 02-17-2017 06:43 AM

Quote:

Originally Posted by bathory (Post 5671881)
I guess you should check if mysql/mariadb is running with the "--skip-networking" option and/or that you have opened port 3306 in your firewall

Regards

Yes to both:
Code:

$ ps ax | egrep -i "mysql|maria" | grep -v grep
14270 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking
14353 ?        Sl    0:18 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --skip-networking --log-error=/var/lib/mysql/hiram.err --pid-file=/var/run/mysql/mysql.pid --port=3306


bathory 02-17-2017 07:28 AM

Quote:

Originally Posted by mfoley (Post 5671981)
Yes to both:
Code:

$ ps ax | egrep -i "mysql|maria" | grep -v grep
14270 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking
14353 ?        Sl    0:18 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --skip-networking --log-error=/var/lib/mysql/hiram.err --pid-file=/var/run/mysql/mysql.pid --port=3306


So ditch "-skip-networking" because AFAIK the jdbc driver connects to the database only through tcp port 3306

mfoley 02-17-2017 11:27 AM

Your exactly right!!! That was it. After the upgrade, I must have told it the replace the current rc.mysqld with the rc.mysqld.new, the latter having '--skip-networking' set. Normally, I don't update the rc or config files for things I am using -- I'll check out the new versions later. BUT, in this case I apparently did clobber the running rc.mysqld with the new release vanilla version!

Thanks!


All times are GMT -5. The time now is 02:08 AM.