Connecting to LightSail with MySQL Connector ODBC

0

I am using a Ubuntu image on Lightsail, and created a mariaDB database for my LAMP application. However, I am getting an error when trying to use MySQL Connector/ODBC to connect to the database from my Windows 10 laptop.

[MySQL][ODBC 8.0(w) Driver] Can't connect to MySQL server on '(IP address)' (10060).

My concern is that the LightSail console (database tab) says I don't have any databases. Yet, I have already created that mariaDB database and restored a mysqldump and the database is working just fine.

Do I need to recreate my database somehow, or register my existing database with the LightSail Console/Database tab somehow?

To connect Filezilla to my Lightsail instance, I had to use the security keys. Do I have to use them now?

Thank you in advance.
Zoomiest

Edited by: zoomiest on Jun 15, 2019 3:33 AM

Edited by: zoomiest on Jun 15, 2019 3:34 AM

Edited by: zoomiest on Jun 15, 2019 3:35 AM

asked 3 years ago14 views
4 Answers
0

Where did you create the schema? In your Ubuntu instance mariaDB server or in a Lightsail managed database?

If the database tab in Lightsail says there are no databases, then you don't have a managed database.

If you created the schema in your Ubuntu instance, then you'll need to open port 3306 for the instance in order to connect.

David G
answered 3 years ago
0

Thank you, David. I have opened port 3306 using the Security interface in LightSail.

I see an error made in my questions. The error message is actually 10061, instead of 10060.

So, I am still not connecting. Still getting:

[MySQL][ODBC 8.0(w) Driver] Can't connect to MySQL server on (IP Address) (10061):

.

When I do a netstat, MySQL seems to be listening on 3306, but I don't know about those zeros for an IP...

ubuntu@host:/$ netstat -plutn
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::80                   :::*                    LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
udp        0      0 127.0.0.53:53           0.0.0.0:*                           -                   
udp        0      0 172.26.6.174:68         0.0.0.0:*                           -

Further, I went into MySQL and granted privileges from any IP address... (less secure, I know)

# GRANT ALL ON database.* TO 'user'@'%' IDENTIFIED BY 'password';

Any thoughts? I continue to wonder about the AWS Lightsail platform, as i am unfamiliar with it... Any platform-specific hurdles I am missing?

answered 3 years ago
0
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -
      ```

The netstat output identifies the problem.

You have the database server configured to listen on 127.0.0.1, which means it will only listen to clients running on that machine.

You'll need to change your /etc/my.cnf file ...

[mysqld]
bind-address    = 0.0.0.0

Also, if the my.cnf file shows 'skip-networking', comment that out.

david

David G
answered 3 years ago
0

THANK YOU DAVID!
We are in, now!

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions