简体   繁体   English

MariaDB 10.4.10 错误 1146 (42S02):表 'mysql.user' 不存在

[英]MariaDB 10.4.10 ERROR 1146 (42S02): Table 'mysql.user' doesn't exist

I understand that in MariaDB 10.4.1 the mysql.user table was replaced by mysql.global_priv table.我知道在 MariaDB 10.4.1 中 mysql.user 表被 mysql.global_priv 表取代。 The documentation says "mysql.user is now a view".文档说“mysql.user 现在是一个视图”。 When I login to a fresh install (using homebrew on os x) as root using socket connection I do not see this view.当我使用套接字连接以 root 身份登录到全新安装(在 os x 上使用自制软件)时,我看不到此视图。 This is causing my GUI (sequel pro) to not work.这导致我的 GUI(续集专业版)无法正常工作。 Am I missing a setup step that creates this backwards-compatible view?我是否缺少创建此向后兼容视图的设置步骤?

MariaDB [(none)]> select * from mysql.user;
ERROR 1146 (42S02): Table 'mysql.user' doesn't exist

This may or may not be what was causing the issue for you, but it just fixed it for me – although I thought I'd checked up and down, back and front, it still turned out to be a permissions issue.这可能是也可能不是导致您出现问题的原因,但它只是为我解决了问题 - 尽管我认为我已经上下、前后检查过,但结果仍然是权限问题。

In my case, it was not only mysql.user which was reported as missing, but also mysql.columns_priv (when I tried flushing privileges).就我而言,不仅mysql.user被报告为丢失,还有mysql.columns_priv (当我尝试刷新权限时)。 I could use mysql just fine, but show tables after that gave me the following error:我可以很好地use mysql ,但是之后show tables给了我以下错误:

ERROR 1018 (HY000): Can't read dir of './mysql/' (errno: 13 "Permission denied")错误 1018 (HY000): 无法读取 './mysql/' 的目录 (errno: 13 "Permission denied")

That didn't immediately make sense to me, but it apparently means that the mysql data directory is not readable by the _mysql user used by the MariaDB server.这对我来说没有立即意义,但这显然意味着 MariaDB 服务器使用的_mysql用户无法读取mysql数据目录。

I have MariaDB running as a Homebrew service, so I looked in the MariaDB MXCL plist file (located in your Homebrew Cellar folder; for me that's /usr/local/Cellar/mariadb/10.4.10_1/homebrew.mxcl.mariadb.plist ): under the key ProgramArguments , there should be a --datadir argument which specifies which directory MariaDB uses to store data.我将 MariaDB 作为 Homebrew 服务运行,所以我查看了 MariaDB MXCL plist 文件(位于您的 Homebrew Cellar 文件夹中;对我来说是/usr/local/Cellar/mariadb/10.4.10_1/homebrew.mxcl.mariadb.plist ) :在ProgramArguments键下,应该有一个--datadir参数,用于指定 MariaDB 用于存储数据的目录。 Mine is /usr/local/var/mysql , which I'm guessing is standard.我的是/usr/local/var/mysql ,我猜这是标准的。

In my case, I had previously had a regular (ie, non-MariaDB) installation of MySQL 5.6 that had used the same data directory, which was probably the culprit – when I looked at the permissions on that directory, it was owned by my own user, and the _mysql user only had read permissions.在我的例子中,我以前有一个使用相同数据目录的 MySQL 5.6 的常规(即非 MariaDB)安装,这可能是罪魁祸首——当我查看该目录的权限时,它归我所有自己的用户,而_mysql用户只有读取权限。

Once I gave _mysql read and write permissions on that folder, lo and behold, my mysql.user view, along with everything else in the mysql database, suddenly sprang into view and worked exactly as it's supposed to.一旦我授予_mysql对该文件夹的读写权限,瞧,我的mysql.user视图以及mysql数据库中的所有其他内容突然出现在视图中并完全按预期工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误1146(42S02):表'mysql.general_log'不存在 - ERROR 1146 (42S02): Table 'mysql.general_log' doesn't exist MySQL 错误 1146 (42S02): 表不存在 - MySQL Error 1146 (42S02): Table Doesn't Exist 错误 1146 (42S02):调用存储过程时表 'mysql.proc' 不存在 - ERROR 1146 (42S02): Table 'mysql.proc' doesn't exist while calling a stored procedure 错误1146(42S02):表'aldobowi.section'不存在 - ERROR 1146 (42S02): Table 'aldobowi.section' doesn't exist 错误1146(42S02):表't.test_0'不存在,但表在表列表中 - ERROR 1146 (42S02): Table 't.test_0' doesn't exist comes out, but the table is in the table list SQLSTATE [42S02]:未找到基表或视图:1146表X不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table X doesn't exist SQLSTATE [42S02]:未找到基表或视图:1146 表 'dbs1056212.User_Logs' 不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbs1056212.User_Logs' doesn't exist 导入到我的数据库时出错:第 217004 行的 ERROR 1146 (42S02):表 'caol2.cao_curriculo' 不存在 - Error importing into my database: ERROR 1146 (42S02) at line 217004: Table 'caol2.cao_curriculo' doesn't exist Laravel-[PDOException] SQLSTATE [42S02]:找不到基本表或视图:1146表'ip.priorities'不存在 - Laravel - [PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ip.priorities' doesn't exist SQLSTATE [42S02]:找不到基表或视图:1146表'docgenerator.curricula'不存在 - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'docgenerator.curricula' doesn't exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM