MySQL 连接到 google 应用引擎实例

MySQL connect to google app engine instance

我有一个 google 应用引擎应用程序和云 SQL 设置,我已将应用程序附加到实例,但现在我必须连接我的计算机 (MAC OS X) 使用 MySQL 客户端(终端)到实例。根据 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)

有什么想法吗?

将 space 添加到 IP --username 后,您需要在 Cloud SQL -> Access Control -> Allowed Networks 中添加您的 IP 地址作为允许的 IP 地址进行访问。