【发布时间】:2017-03-12 05:37:08
【问题描述】:
我正在同一个项目中从 App Engine 访问 Cloud SQL。我已将密码设置为root用户。因此,我可以从 mysql 命令行远程连接:
C:>mysql -u root -h xxx.xxx.xxx.xxx -p <- IP address of my Cloud SQL
Enter password: <--- I supply passw0rd
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 20913
Server version: 5.7.14-google-log (Google)
但是,当我从 App Engine 尝试时:
代码sn-p:
url = "jdbc:google:mysql://myproject:us-central1:myinst/mydb?user=root;password=passw0rd";
conn = (Connection) DriverManager.getConnection(url);
我得到的错误是:
com.google.gae.server.Connect getConnection: ERROR. Could not get connection. Access denied for user 'root;password=passw0rd'@'cloudsqlproxy~xxx.xxx.xxx.xxx' (using password: NO)
我只用用户尝试了 url,但没有运气。
感谢任何建议。
【问题讨论】:
标签: google-app-engine google-cloud-sql