MySQL Database remote connection

SYSTEM INFORMATION
OS type and version Ubuntu Linux 18.04.6
Webmin version 1.990

Hi,

I have two issues :

  1. I tired to set up the MySQL Server for remote connections on database created via Virtualmin but to no avail, I search for documentations, my 3306 port is open (I checked), I have user permissions and database permissions set up normally but nothing seems to make me able to make it work.

I need this remote connection for development purposes

  1. When trying to set up that connection I realise it seems I can’t even run a simple “mysql -u root -p” as it says “Enter password: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)” Just running “mysql -u root” as the same effect, as it seems my root don’t have access to it, tho I do have access to the MySQL Database module in Webmin and can change the config as I see fit.

Now the second issue wouldn’t be an issue tbh, but I have the feeling it’s in correlation or needed to be fixed to resolve the first issue.

If anyone could help, it’d be appreciated I don’t seem to find anything to help me and I am starting to go crazy. I can provide screenshots or whatever information on the current config as needed.

Thank you in advance.

did you set the database server to listen on all interfaces (0.0.0.0) ? TBH using such an old version of webmin & an unsupported OS you may start to develop all sorts of issues, this may be the time to update both.

I’ve tried with “Any” but not a manual “0.0.0.0” inputted. Would that make any difference?

I may try to update both, but I have things running on it so having a downtime is a bit of an issue for me. I’d rather find a solution on the current solution if possible …

I have it working with this


after the change don’t forget to restart the mysql server

have you allowed root access in the Database permissions?

image

Ok I’m getting the same issue, I think the root password is not the password used for the system root.

Maybe reset the root password in the mysql user root via User Permissions in Mysql.

Worked for me

root@server:~# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 46
Server version: 10.5.22-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

@jimr1 @stefan1959

Sadly none of your help yielded some results.

Can you login as a domain owner rather than root ?

Tried it didn’t work. Same error message.

I am kind of daunted by this thing. I just cant figure out why it’s not working tbh

Just to be clear you are entering a password as it should say YES if the password fails if you just hit enter it will say NO

like this
root@server:~# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
root@server:~# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
root@server:~#

1 Like

I did not understand the difference between the two lines presented

The first line is with a incorrect password therefore response is (using password: YES)
Second line I just hit enter with no password therefore (using password: NO)

your error indicates your not entering a password

This might seem a silly approach to the problem but

Why not start a new VM clean with spanking new up-to-date OS and GPL Virtualmin with everything up-to-date and use that as a test environment to resolve the problem. Then at least you will know what is at fault.

MySQL user/permissions are at fault (the error tells us that). This error is not indicative of a massive system problem.