我遇到错误(在Google Cloud上的MySQL 5.7.25-google上,而在本地MySQL 5.7.29上,它工作正常)
我运行Google Cloud(注意:显示表显示的是该用户存在的该表!!!)
mysql> show index from customers;
ERROR 1146 (42S02): Table 'authtables.customers' doesn't exist
在本地(相同的用户,密码和设置),我得到
mysql> SHOW INDEX FROM customers;
+-----------+------------+------------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-----------+------------+------------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| customers | 0 | PRIMARY | 1 | id | A | 2 | NULL | NULL | | BTREE | | |
当然,命令SHOW TABLES;在两者上均相同,并在两者中显示CUSTOMERS表!
我按照下面链接中的可接受答案回答,其中有1个次要细节,用于将“ authservice”用户设置为“ authtables”数据库...
Mysql adding user for remote access
一个细节是我的授予语句是authtables。*,因此用户可以完全访问authtables数据库,而没有其他权限。
NEXT是我在GCP中的show Grants命令,在本地产生完全相同的结果,但是如果我错过了一个错字,这里是GCP,然后是本地结果
mysql> show grants for 'authservice'@'localhost';
+---------------------------------------------------------------------+
| Grants for authservice@localhost |
+---------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'authservice'@'localhost' |
| GRANT ALL PRIVILEGES ON `authtables`.* TO 'authservice'@'localhost' |
+---------------------------------------------------------------------+
2 rows in set (0.08 sec)
本地结果是
mysql> show grants for 'authservice'@'localhost';
+---------------------------------------------------------------------+
| Grants for authservice@localhost |
+---------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'authservice'@'localhost' |
| GRANT ALL PRIVILEGES ON `authtables`.* TO 'authservice'@'localhost' |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)
为了完整性... GCP版本:服务器版本:5.7.25-google-log(Google) 本地版本:服务器版本:5.7.29 MySQL社区服务器(GPL)
哇,废话,什么是5.7.25-google-log ... ICK。我不知道这里是否有错误。
此外,为什么格兰特有。。当我查看我在mysql中的历史进行验证时,我显然做了authtables。*每次!!!
然后,'authservice'@'%'授予发生了什么,因为我也没有看到?
任何人都不知道如何设置google cloud mysql,因此我有一个对数据库具有完全访问权限的用户,所以他只能使用该数据库?这似乎有点像Google的bug,或者我做错了什么?
谢谢, 院长
答案 0 :(得分:0)
OMG,Google的mysql“表名”区分大小写!!!什么鬼。
我必须做
show index from CUSTOMERS;
OR
SHOW INDEX FROM CUSTOMERS;
但这不起作用
show index from customers;
哎哟!发布此消息以帮助下一个人。