简体   繁体   中英

GCE and Debian - Unable to connect to MYSQL from TOAD

In Google Compute Engine, LAMP installed using 'click to Deploy'. I have enabled ALLOW HTTP,HTTPS traffic also in the API console.

I couldn't connect MySQL via Toad. I tried the following Connection Type 1.SSH, 2.TCP, 3.SSL.

Refer this image:

在此处输入图片说明 .

I got issues while connecting through any of these three connection types. How to connect MySQL(created using GCE) via Toad?

I used SSH keys also, is there any specific method to connect to this mySQL created via GCE?

My remote server my.cnf file

If you want to connect to Mysql from a remote PC with Toad:

1) Add a firewall rule in the Developer Console Compute Engine network page to allow tcp:3306 (mysql port) to your IP or to everyone (0.0.0.0/0, easier but not secure) and then use Toad TCP connection.

2) Check that mysql user accepts connections from your IP or from every IP (%) or create a new mysql user. You can connect to instance in SSH and give the following commands to create a new Mysql user:

mysql -u root -p

then create user (change 'newuser' and 'password' according to your needs) :

CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';

Grant user permission:

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%';

FLUSH PRIVILEGES;

exit;

If connection still fails:

3) Check that mysql is listening on all IP addresses, for Debian see in /etc/mysql/my.cnf and change bind-address to :

bind-address = 0.0.0.0

and restart mysql:

/etc/init.d/mysql restart

Hope this helps.

Sincerely, Paolo

Id try to access mysql from another server in the same network and project to help narrow down where your requests are getting blocked. If you can access mysql from another instance then it could be your firewall rules.

Also, does debian have iptables or another software firewall enabled by default?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM