我有一个谷歌应用引擎应用程序和 Cloud SQL 设置,我已将应用程序附加到实例,但现在我必须使用 MySQL 客户端(终端)将我的计算机 (MAC OS X) 连接到实例。根据 GAE 教程:
shell> mysql --host=instance-IP --user=user-name --password
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.31 (Google)
....
mysql>
但这是发生了什么(主机是实例的 IP 地址)我不知道该把什么作为用户名?:
Tom$ mysql --host=173.194.225.73--user=username --password
Enter password:
ERROR 2005 (HY000): Unknown MySQL server host '173.194.225.73--user=username' (0)
有什么想法吗?
最佳答案
将空格添加到 IP --username 后,您需要在 Cloud SQL -> 访问控制 -> 允许网络中添加您的 IP 地址作为允许的 IP 地址访问。
关于MySQL连接到谷歌应用引擎实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28793800/