Unable to connect to DB


I'm getting the connection error shown below.
I recreated the link with no avail. Rewritten the credentials with no avail either.
My ESP connects to the DB without a problem using the same credentials.
How can I troubleshoot my problem?


Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user_iot'@'' (using password: YES)

What database type is that?
The error suggests that you are trying to connect from a Russian IP address on the internet, are you trying to access a database across the internet?

:thinking:Russian? I’m in Spain and I’m connecting to my ISP’s mySql server which is about 20km from me. Will look up on that ip. Thanks.

EDIT: I remember now I made some changes to that IP for troubleshooting reason. The actual IP is

Can you connect from the command line mysql client on the machine running node-red? Something like
mysql --host=<mysql host ip> --user=user_iot --password=<thepassword>

:sweat_smile: It looks like on this new rpi board I didn't install mysql:

-bash: mysql: command not found

What do you mean you made changes to the IP? That should be the external IP of the system. You can't change it (well not usually).

I think you probably need to install mysql-client to get the command line client.
sudo apt install mysql-client
Node red shouldn't need that though.

I know but I was just playing with the IP to see if the error would change.

Package 'mysql-client' has no installation candidate

I guess I need to install the whole DB package?

I don't understand how you could play with the IP. You shouldn't be specifying it anywhere, it is automatic.

In the mysql config window you can set the ip, the user and the password.

The mysql server is not on my machine. It's located on the ISP's server.

That is the IP of the server, not the ip of the pi. The error is saying you can't connect to the server from At least I think that is what it is saying.

Actually, https://www.whatismyip.com/ returns a different IP, so it's not mine but ISP's.

Anyhow, as I stated earlier, I have no problems with my ESP connecting to the mysql server with the identical credentials.

That is a pain, it seems the mysql client isn't in a separate package in Raspbian.
When you said you could connect from ESP, what did you mean by that?

The ESP sends the data to the server every so often. Node-red reads it and display it.

What is an ESP?

Sorry, ESP/ESP8266/ESP32 are microcontrollers.

Is that on the same local network as the pi?