0
mysql -V
mysql  Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I can connect with:

 mysql -h localhost  -uroot -pmysecretPassword

Then I try to connect with

mysql -h XXX.XXX.XXX.XXX -uroot -pmysecretPassword

and Got ERROR 1045 (28000): Access denied for user 'root'@'ns10003.XXXXX' (using password: YES)

where XXX.XXX.XXX.XXX is my server IP

I test it with

telnet XXX.XXX.XXX.XXX 3306 

I got a connection so : mysql runs on XXX.XXX.XXX.XXX on port 3306

My config mysql file /etc/mysql/mariadb.conf.d/50-server.cnf

is

[mysqld]
innodb_strict_mode = 0
sql-mode="NO_ENGINE_SUBSTITUTION"

#
# * Basic Settings
#
user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
socket                  = /run/mysqld/mysqld.sock
#port                   = 3306
basedir                 = /usr
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
lc-messages-dir         = /usr/share/mysql
#skip-external-locking
#skip-networking=1
#skip-bind-address

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address            = 127.0.0.1
bind-address            = 0.0.0.0

Everything looks good for me. No iptables rules:

Why Cannot I connect to my server remotely or using its IP ?

yarek
  • 11,278
  • 30
  • 120
  • 219

0 Answers0