问题
i was trying to access remotly to mysql mariaDB
this is my my.cnf file
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
#skip-networking
#bind-address = <some ip-address>
something missing in client-server section maybe ?
i restarted mysqld with this command
systemctl restart mysqld
there's only one user (the one i used to connect from the other server) and % for thar user's host
i use this command in the other server
mysql -h 5.xxxx -P3306 -u myUsernameInTheOtherServer -pMYPASS -D myDatabaseNameThatHaveThatUser
i got: ERROR 2002 (HY000): Can't connect to MySQL server on '5.x' (115)
the weird thing is
i used this command for the first time
service iptables stop
and suddenly, it connected succeffuly with the same command i used
after i exit using ctrl+c, and tried to login again but i got the same error
when i try to connect on the server that have the mysql, using the user i created for the remote connection i got
ERROR 1045 (28000): Access denied for user 'userIusedForRemoteConn'@'localhost' (using password: YES)
so, if i can't login using that user on the main server, i can't login remotly using it, right ?
here's that user(in red) that i used, can it be the problem from root ?
i'm using da_admin, to create that user and all other commands
来源:https://stackoverflow.com/questions/60254615/error-2002-hy000-cant-connect-to-mysql-server-on-myserverip-115