LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-16-2017, 09:25 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,539

Rep: Reputation: 177Reputation: 177
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?
 
Old 02-17-2017, 02:21 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
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
 
Old 02-17-2017, 06:43 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,539

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by bathory View Post
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
 
Old 02-17-2017, 07:28 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Quote:
Originally Posted by mfoley View Post
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
 
1 members found this post helpful.
Old 02-17-2017, 11:27 AM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,539

Original Poster
Rep: Reputation: 177Reputation: 177
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!
 
  


Reply

Tags
communications, failure, link, mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql -u root -p fails to connect jojanmpaul Linux - Software 3 04-23-2014 11:10 PM
cannot connect to mysql database while redirecting apache to tomcat mlnm Linux - Newbie 1 07-19-2012 09:49 AM
Win 7 - Tomcat unable connect to MySQL mlnm General 2 04-13-2012 09:16 AM
PHP can't connect MySQL after upgrading to php5 Mikessu *BSD 2 08-13-2004 02:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration