Ismael Moral
Ismael Moral

Reputation: 732

Cannot connect remotelly to a mariadb server

I'm trying to connect to a mariadb server remotelly using terminal, but I get a little issue about that.

Preconditions

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

Answers (1)

bemar
bemar

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

Related Questions