Can't remote connect to Mariadb even following the setup guides.

November 12, 2014 7k views

I'm not sure if you can help here but I followed your page on how to install mariadb on centos 7 https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7 and I seem to have an issue. I can access the database only if I'm logged directly into the VM it's running on. It won't allow me access via ssh or mysql workbench 6.2. I have double checked the port. and added myself as a user using the "GRANT ALL PRIVILEGES ON . TO testuser@'address' IDENTIFIED BY 'secretpassword';" and then flushed privileges and restarted mariadb. Nothing seems to work. Do you have any ideas as to why this might be? I did check the my.cnf file and it seems to be different than the one shows on the official mariadb site. https://mariadb.com/kb/en/mariadb/documentation/getting-started/configuring-mariadb-for-remote-client-access/ .


  • What kind of error are you getting? Is it connecting then failing on authorization, or does it fail immediately? Is there firewalling set up on the server? Try opening the port of MariaDB:

    firewall-cmd --permanent --zone=public --add --port=3306/tcp
  • Did you get this figured out. I'm also having trouble getting connected to MariaDB through a ssh tunnel. I can ssh into the remote machine and then connect to it, but I can't connect to it without doing that. I was able to finally connect to it through ssh tunnel but I had to grant all permission to user@% and I don't want to do it that way if I can help it.

Be the first one to answer this question.