ubuntu下mysql有表却提示table doesn't exist

本文介绍了如何在Linux环境下配置MySQL使其不区分大小写。通过编辑配置文件mysqld.cnf并添加lower_case_table_names=1参数实现。适用于希望统一表名大小写的开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

linux里面的mysql是区分大小写的,windows下的mysql不区分。在mysql的安装目录里面找到mysqld.cnf文件,在[mysqld]的下面(可以看到还有别的配置信息)添加   lower_case_table_names=1   就行了。

我的这个配置文件的目录是/etc/mysql/mysql.conf.d文件夹下。

2025-07-15T01:47:13.079564Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2025-07-15T01:47:13.085230Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2025-07-15T01:47:13.085268Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2025-07-15T01:47:13.089551Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2025-07-15T01:47:13.091858Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:47:13.092032Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist 2025-07-15T01:47:13.092048Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition. 2025-07-15T01:47:13.092168Z 0 [ERROR] [MY-000068] [Server] unknown option '--skip-host-cache'. 2025-07-15T01:47:13.092876Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-07-15T01:47:14.634541Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.3) MySQL Community Server - GPL. 2025-07-15T01:47:14.634553Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2025-07-15 01:48:14+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.3-1.el9 started. 2025-07-15 01:48:15+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2025-07-15 01:48:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.3-1.el9 started. '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' 2025-07-15T01:48:15.303942Z 0 [System] [MY-015015] [Server] MySQL Server - start. 2025-07-15T01:48:15.484047Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.3) starting as process 1 2025-07-15T01:48:15.489065Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-07-15T01:48:15.826051Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. mysqld: Table 'mysql.plugin' doesn't exist 2025-07-15T01:48:15.987952Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure. 2025-07-15T01:48:15.988248Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.988425Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.988643Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.988936Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.989117Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.989241Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:15.989393Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:16.029511Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2025-07-15T01:48:16.102642Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2025-07-15T01:48:16.109042Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. 2025-07-15T01:48:16.109065Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel. 2025-07-15T01:48:16.112856Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. 2025-07-15T01:48:16.113111Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:48:16.113337Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist 2025-07-15T01:48:16.113352Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition. 2025-07-15T01:48:16.113509Z 0 [ERROR] [MY-000068] [Server] unknown option '--skip-host-cache'. 2025-07-15T01:48:16.114316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-07-15T01:48:17.655908Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.3) MySQL Community Server - GPL. 2025-07-15T01:48:17.655921Z 0 [System] [MY-015016] [Server] MySQL Server - end. 2025-07-15 01:49:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.3-1.el9 started. 2025-07-15 01:49:18+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2025-07-15 01:49:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.3-1.el9 started. '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' 2025-07-15T01:49:18.325189Z 0 [System] [MY-015015] [Server] MySQL Server - start. 2025-07-15T01:49:18.503797Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.3) starting as process 1 2025-07-15T01:49:18.508845Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-07-15T01:49:18.843299Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. mysqld: Table 'mysql.plugin' doesn't exist 2025-07-15T01:49:19.009659Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure. 2025-07-15T01:49:19.009978Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.010198Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.010416Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.010663Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.010788Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.010943Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.011062Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables 2025-07-15T01:49:19.050620Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2025-07-15T01:49:19.125374Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. T
最新发布
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

最强玩者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值