I am currently trying to set up a connection between my host machine, which is a Windows PC, and a remote ubuntu server I can access using an IP-address. Let's say for example my server has the ip-address 200.100.150.100. Then I am able to access it via ssh root@200.100.150.100
, then I have to enter my password and I am on the server. So an ssh connection seems to work.
However on this Ubuntu server I also installed a MySQL-Database, which I want to access. Now when i try to access the MySQL-database with the command mysql -u remoteuser -p -h 200.100.150.100
, I get the following error:
- ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
I tried to solve that and found some posts about that error, I changed the bind address in the file /etc/mysql/mysql.conf.d/mysqld.cnf to 0.0.0.0, created a mysql user like this:
CREATE USER 'remoteuser'@'%' IDENTIFIED BY 'remotepw';
GRANT ALL ON *.* TO 'remoteuser'@'%';
FLUSH PRIVILEGES
However, this still does not resolve the error. I think my network administrator also allowed the required connections to the server (port 3306), but maybe there is still something missing in the firewall settings? Also, I am confused how the connectin to MySQL works, when I connect from my database on the remote machine, I need to enter the MySQL credentials of course, but do I not need to enter my Ubuntu server username and password, like for the SSH connection? I am not very experienced with network connections.
All help appreciated, thanks!