Reputation: 732
I'm trying to connect to a mariadb server remotelly using terminal, but I get a little issue about that.
Preconditions
I have connection to my remote server, and I can enter inside maria db using the next command
mysql -u root -p****
and I enter without problems.
Also I have commented this line of my.conf
from the #bind-address = 127.0.0.1
.
When I'm trying to do this from my computer mysql -u root -h mariadb.testing.des -p****
I get the following error in console
ERROR 1045 (28000): Access denied for user 'root'@'mariadb.testing.des' (using password: YES)
Why am I getting two different results using the same user? What am I doing wrong?
Thanks for the help,
Jaster.
Upvotes: 0
Views: 184
Reputation: 334
It's not enough to ensure your server is reachable from remote. You also have to create a user which has privileges for the remote access to your desired schema. I strongly recommend not to create a remote root user with access to all. Best practice is to create a remote user for every single scheme.
In example: CREATE USER 'jeffrey'@'my.remote.host' IDENTIFIED BY 'mypass'; GRANT ALL ON jeffreys_db.* TO 'jeffrey'@'my.remote.host';
See also: https://dev.mysql.com/doc/refman/5.7/en/create-user.html https://dev.mysql.com/doc/refman/5.7/en/grant.html
Upvotes: 1