首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法配置mysql数据库,在云sql代理安装之后

无法配置mysql数据库,在云sql代理安装之后
EN

Stack Overflow用户
提问于 2018-12-11 02:28:54
回答 1查看 3.3K关注 0票数 3

按照此链接https://cloud.google.com/sql/docs/mysql/connect-admin-proxy配置的云sql代理

启用。使用下面的命令连接到mysql时出错

代码语言:javascript
运行
复制
[prudvee143@centos-2 ~]$ mysql -h 127.0.0.1 -u root -p
Enter password: 
2018/12/11 02:21:34 New connection for "bookshelfs-221608:us-central1:test"
2018/12/11 02:21:34 couldn't connect to "bookshelfs-221608:us-central1:test": ensure that the account has access to "bookshelfs-221608:us-central1:test" (and make sure there's no typo in that name). Error during createEphemeral for bookshelfs-221608:us-central1:test: googleapi: Error 403: Access Not Configured. Cloud SQL Admin API has not been used in project 317520816688 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/sqladmin.googleapis.com/overview?project=317520816688 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

用于此的命令:

代码语言:javascript
运行
复制
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
chmod +x cloud_sql_proxy

[prudvee143@centos-2 ~]$ 2018/12/11 02:14:55 failed to setup file descriptor limits: failed to set rlimit {&{8500 4096}} for max file descriptors: invalid argument
2018/12/11 02:14:55 using credential file for authentication; email=sql-651@bookshelfs-221608.iam.gserviceaccount.com
2018/12/11 02:14:55 Listening on 127.0.0.1:3306 for bookshelfs-221608:us-central1:test
2018/12/11 02:14:55 Ready for new connections
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-11 03:36:26

解决方案是启用Cloud SQL API

您可以使用Google控制台启用API:

  1. 转到APIs & Services
  2. 转到Library
  3. SQL中输入Search for APIs & Services
  4. 选择Cloud SQL Admin API
  5. 单击Enable

您还需要启用Cloud SQL。重复上述步骤。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53716516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档