(待完成)表不存在:MySQL 中 lower_case_table_names 问题探究
source link: https://dongzl.github.io/2023/03/10/05-MySQL-Lower-Case-Table-Name-Problems/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
(待完成)表不存在:MySQL 中 lower_case_table_names 问题探究
原文链接:https://www.percona.com/blog/table-doesnt-exist-mysql-lower_case_table_names-problems/
在 Managed Services 系统中,我们有很多客户,由于每个客户都有不同的系统环境和配置,因此在他们的环境中工作总是很有趣。在这篇博文中,我将展示我们在删除表时遇到的一个问题及其解决方法。
在客户的生产环境(MySQL 5.7
)中有一个需要被删除的表都有一个标识,表名称以 #
符号开头。我认为我们可以很容易地使用引号或反引号来指定要删除的表。但实际效果并没有像我预期的那样,我才知道为什么客户将可以删除的表进行了标识。
以下示例重现了该问题。这里显示了一张表,但是我们却无法看到它的结构,也无法删除它。
mysql> show tables;
+--------------------------+
| Tables_in_percona |
+--------------------------+
| #Tableau_01_bw_F2DD_test |
+--------------------------+
1 row in set (0.00 sec)
mysql> show create table `#Tableau_01_bw_F2DD_test`G
ERROR 1146 (42S02): Table 'percona.#tableau_01_bw_f2dd_test' doesn't exist
mysql>
mysql> drop table `#Tableau_01_bw_F2DD_test`;
ERROR 1051 (42S02): Unknown table 'percona.#tableau_01_bw_f2dd_test'
mysql>
mysql> drop table '#Tableau_01_bw_F2DD_test';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''#Tableau_01_bw_F2DD_test'' at line 1
mysql>
mysql> drop table "#Tableau_01_bw_F2DD_test";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"#Tableau_01_bw_F2DD_test"' at line 1
mysql>
检查 .ibd
和 .frm
文件时,这些文件都是存在的,并且磁盘上物理文件没有问题。
[root@centos12 percona]# ls -lrth
total 112K
-rw-r-----. 1 mysql mysql 65 Dec 20 02:44 db.opt
-rw-r-----. 1 mysql mysql 8.4K Dec 20 02:51 @0023Tableau_01_bw_F2DD_test.frm
-rw-r-----. 1 mysql mysql 96K Dec 20 02:51 @0023Tableau_01_bw_F2DD_test.ibd
[root@centos12 percona]# pwd
/var/lib/mysql/percona
[root@centos12 percona]#
Gitalking ...
Recommend
-
11
一个关于 PHP 的 new 的小问题的探究 前两天有人在群里说了一个关于 new 和 stdClass 的问题,具体表现如...
-
14
Install MySQL 8 on Linux with lower_case_table_names = 1 –Skip to content MySQL stores several files on disk. Even in My...
-
8
原文标题:《MEV 才是正义》撰文:Philip Daian,软件工程师、IC3 @ Cornell 博士生编译:Perry Wang
-
5
dotnet 读 WPF 源代码笔记 了解 WPF 已知问题 用户设备上不存在 Arial 字体将导致应用闪退本文来告诉大家 WPF 已知问题,在用户的设备上,如果不存在 Arial 字体,同时安装了一些诡异的字体,那么也许就会让应用在使用到诡异的字体的时候,软件闪退...
-
14
黑群晖 “抱歉,您所指定的页面不存在” 问题解决方法不需要重装,可以完全远程操作 黑群晖 DSM 6.1.7-15284 Update 3 开启 SSH 黑群晖突然抽风,访问 IP+端口(http 或 https),页面显示 “抱歉,您所指定的页面不存在”...
-
4
软件安全问题探究 – 安全意识博客Skip to content 在IT行业里,软件开发人员是专业技术水平比较高的一类。高校每年都会生产出大量的计算机科学和软件工程...
-
7
V2EX › Python mysql 如果不存在,插入,还有更快的写法吗? wuwukai007 · 5 小时 39 分...
-
2
The edge of the table appears in the lower right corner advertisements I am working on a table and for some reason, when I...
-
7
Table Doesn’t Exist: MySQL lower_case_table_names Problems ...
-
2
深入探究 MySQL 数...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK