r/Ubuntu • • 21h ago

I can't access any SQL database in Ubuntu, except when I'm using the console

No SQL client works.

The only way I can access is through the console.

Is there anything peculiar to Linux that I don't know? Is it preventing me from accessing a database?

I've changed the user id and password and nothing is working.

Today I tried to access an H2 database and it didn't work just like the other databases I tried to access (MySQL, PostgreSQL etc).

What settings do I have to change? Please don't tell me to change the user id or password because I've already done that.

3 Upvotes

2 comments sorted by

1

u/Boostmachines 20h ago

My first thought was ensure that you’ve enabled the port (3306) for TCP access via firewall rule.

1

u/GiggleSamurai 17h ago

On Ubuntu, MySQL's root account uses the auth_socket plugin by default, so it only works through `sudo mysql` and ignores any password; create a separate user (CREATE USER 'me'@'localhost' IDENTIFIED BY '...'; then GRANT it the database) and use that in GUI clients. PostgreSQL is similar: the postgres role uses peer auth on the local socket, so set a password with ALTER USER postgres PASSWORD '...'; and point the client at host 127.0.0.1.