phpmyadmin connecting to cloud sql

524 views
Skip to first unread message

Allen Saslaw

unread,
Dec 9, 2017, 12:10:24 PM12/9/17
to Google Cloud SQL discuss

Hello. I am attempting to connect phpmyadmin to cloud sql. This should be pretty simple but can't seem to make it work. I am connecting from a GCE instance. 
I have added the GCE IP address to the authorization section of my Google SQL server. Below is my config.inc settings. It simply does not connect. Errors with connection refused. What am I missing here? 
Been staring at this for too long and not sure what is missing. 

Do I need MYsql client installed and running on GCE to use phpmyadmin to connect to Google SQL? 

$cfg['Servers'][$i]['host']          = '<SERVER IP>';
$cfg['Servers'][$i]['port']          = '3306';
$cfg['Servers'][$i]['socket']        = '';
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['extension']     = 'mysql';
$cfg['Servers'][$i]['user']          = 'root';
$cfg['Servers'][$i]['password']      = 'password';
$cfg['Servers'][$i]['auth_type'] = 'config';       // keep it as config
$cfg['Servers'][$i]['AllowRoot']     = TRUE;
$cfg['Servers'][$i]['AllowNoPassword']   = TRUE;

Kamran (Google Cloud Support)

unread,
Dec 9, 2017, 5:41:42 PM12/9/17
to Google Cloud SQL discuss

Hello Allen,

In order to isolate the cause of issue, I'd recommend trying to connect to your Cloud SQL instance using mysql client by following the instructions described in this article. After a successful connection, you can then inspect the configuration of phpMyAdmin’s client. For further information on phpMyAdmin’s configurable data, you can refer to this doc. Please note that it is recommended to use mysqli as value for $cfg['Servers'][$i]['extension'] .

I hope this helps.

Allen Saslaw

unread,
Dec 9, 2017, 6:08:33 PM12/9/17
to Google Cloud SQL discuss
Hello! I have already connected successfully from mysqlwork bench on my macbook. Really, this is just an exercise rather than a production need. Mysqlworkbench just needed IP and username/password and connected with no issues. Also, phpmyadmin connects to the locally installed mysql on the GCE instance. Is there a required firewall rule for 3306 for GCE instance? The cloud SQL and GCE instance are in the same project. 

I will review the doc for phpmyadmins configurable data but as of now still not connecting.

Thanks!

Allen

Kamran (Google Cloud Support)

unread,
Dec 11, 2017, 11:27:41 PM12/11/17
to Google Cloud SQL discuss
By default, outgoing traffic to port 3306 are allowed on GCE firewall, therefore there should not be needed to add extra firewall rules for this connection on GCE firewall.
Reply all
Reply to author
Forward
0 new messages