I am having trouble connecting to my remote MySQL server which is hosted on a CentOS7 server.
It was working well before then 1 day it just stop working and start throwing me these errors:
From my windows box:
Connection Failed: [HY000][MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on '10.103.23.234' (10090)
From my other CentOS server:
ERROR 2003 (HY000): Can't connect to MySQL server on '10.103.23.234' (113)
So I looked for the top search result regarding the issue I'm experiencing and came across to many of the suggested solutions.
I already binded my server's ip to MySQL config file at /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
bind-address=10.103.23.234
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
Due to frustrations, I did delete-create the user and grant privileges on MySQL user
MariaDB [(none)]> SHOW GRANTS FOR 'faultanalytics'@'%';
+---------------------------------------------------------------------------------------------------------------+
| Grants for faultanalytics@% |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'faultanalytics'@'%' IDENTIFIED BY PASSWORD '*82CB5B45DC157D1466E8A2F031A55B06D9C8F9FA' |
| GRANT ALL PRIVILEGES ON `outageTicket`.* TO 'faultanalytics'@'%' |
+---------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> SELECT * FROM mysql.db WHERE user='faultanalytics' AND host='%' AND db='outageTicket'\G;
*************************** 1. row ***************************
Host: %
Db: outageTicket
User: faultanalytics
Select_priv: Y
Insert_priv: Y
Update_priv: Y
Delete_priv: Y
Create_priv: Y
Drop_priv: Y
Grant_priv: N
References_priv: Y
Index_priv: Y
Alter_priv: Y
Create_tmp_table_priv: Y
Lock_tables_priv: Y
Create_view_priv: Y
Show_view_priv: Y
Create_routine_priv: Y
Alter_routine_priv: Y
Execute_priv: Y
Event_priv: Y
Trigger_priv: Y
1 row in set (0.00 sec)
ERROR: No query specified
BUT I NOTICE SOMETHING STRANGE on this NEXT TABLE BELOW, I can only see "USAGE" privilege for user 'faultanalytics'@'%'
MariaDB [(none)]> SELECT * from information_schema.user_privileges WHERE GRANTEE='\'faultanalytics\'@\'%\'';
+----------------------+---------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+----------------------+---------------+----------------+--------------+
| 'faultanalytics'@'%' | def | USAGE | NO |
+----------------------+---------------+----------------+--------------+
I am thinking, is this the reason why I can't connect remotely to my MySQL server?
Checked my ports
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 10.103.23.234:3306 0.0.0.0:* LISTEN