I am having MySQL connection issues. I cant pinpoint as to why.

I have a main firewall and a server behind it.

I have verified that my main server is allowing 3306 through to my server and I can see after running netstat and trying a test connection with MySQl Workbench that I think it connects.

[root@indie ~]# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State      
tcp        0      0 indie.theindiecompanyl:http mail221.theindiecomap:35453 SYN_RECV    
tcp        0      0 indie.theindiecompany:mysql mail221.theindiecomap:43298 ESTABLISHED

Notice the second line. it says established. But my connect fails still.

So, I think I need to examine the fact that maybe the mysql root password that I am using is wrong.

So I tried: 1. /etc/init.d/mysqld stop 2. /usr/bin/mysqld_safe --init-file="/tmp/code.sql" &

Where code.sql contains:

UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';
FLUSH PRIVILEGES;
commit;

GRANT ALL ON mysql.* to 'root'@'127.0.0.1';
FLUSH PRIVILEGES;
commit;

GRANT ALL ON mysql.* TO 'root'@'localhost';
FLUSH PRIVILEGES;
commit;

GRANT ALL ON mysql.* TO 'root'@'my public IP at home';
FLUSH PRIVILEGES;
commit;
  1. I then try to connect using root and mypassword and I still get the (4) error.

  2. /var/log/mysqld.log shows nothing except that mysql has started.

stumped.

A few questions. 1. Is there a log that shows connections, failed attempts, etc. Maybe that will have an error as to why I get the (4) error.

  1. Is there a way to reset the root password without starting in safe mode and doing this SQL?

  2. What else can I look for because it is obvious that MySQL is running since my Word Press is running, I just cannot connect from my remote system.

link|improve this question
feedback

1 Answer

Blackbox troubleshooting of network problems is painful and unnecessary. Turn it into an open box by running Wireshark or tcpdump.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown