Score:0

How to connect to MariaDB remotely

fr flag

I rarely use Linux as I'm a .Net developer and it is my first time using Debian, I have always used Ubuntu before on rare occasions.

I'm trying to connect to MariaDB. and I succeed locally both using localhost or host IP address, but remotely it fails.

What I have done so far (using instructions on the web):

  1. Installed MariaDB and created a user with a password. and granted access on all databases:

    GRANT ALL ON *.* TO 'theusername'@'%' IDENTIFIED BY 'mypassword';
     FLUSH PRIVILEGES;
    

    enter image description here

  2. changed to bind-address = 0.0.0.0 on mariadb.conf.d/50-server.cnf

and can confirm it by the following result:

$ netstat -ant | grep 3306 returns

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
  1. Firewall is not installed on the server.

4.MariaDB service is running and as I said I'm able to connect even with IP address from local computer.

the server is hosted on Amazon AWS.

Nikita Kipriyanov avatar
za flag
Looks like this is NAT issue. Your database is behind AWS's NAT and has private IP; you can't connect to a private IP over the Internet. You need to forward port 3306 on the network gateway to your database server, and connect to the corresponding public IP. Or, setup VPN and go through it.
cn flag
Or it's the AWS security group not allowing access
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.