MySQL 为什么我的表名在 phpmyadmin 中被转换成小写?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2659684/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 15:48:39  来源:igfitidea点击:

Why my tables' names are converted into lowercase in phpmyadmin?

mysqlphpmyadminwampserver

提问by Awan

I am using wamp server 2.0 on Windows XP. Whenever I create a table with some uppercases in name, it is converted to lowercase.

我在 Windows XP 上使用 wamp server 2.0。每当我创建一个名称为大写的表格时,它都会被转换为小写。

For example:

例如:

I create: UserInfo
phpmyadmin convert it to: userinfo

I am using ubuntu/phpmyadmin in office but this problem does exists there.

我在办公室使用 ubuntu/phpmyadmin 但这个问题确实存在。

from where can I fix this. Thanks

我可以从哪里解决这个问题。谢谢

采纳答案by NebuSoft

There is a directive for forcing table names to lower case.

有一个强制表名小写的指令。

You want to set the lower_case_table_names value to 0.

您想将 lower_case_table_names 值设置为 0。

You can read more about it from MySQL documentation here

您可以在此处从 MySQL 文档中阅读有关它的更多信息

回答by Loaderon

I've tried what's been suggested here, i must inform that

我已经尝试过这里建议的内容,我必须通知

lower_case_table_names = 0

doesn't work in xampp, it crashes MySQL service at the moment you restart it. Yet

在 xampp 中不起作用,它会在您重新启动 MySQL 服务时崩溃。然而

lower_case_table_names = 2

didn't crash, and apparently worked... at least it allowed me to insert a db with camel case.

没有崩溃,而且显然有效......至少它允许我插入一个带有骆驼案例的数据库。

回答by Ahmed Al Bermawy

In windows the default value for lower_case_table_names = 1.

在 Windows 中,默认值为lower_case_table_names = 1.

You need to change or add this value to my.ini file in your mysql folder..

您需要将此值更改或添加到 mysql 文件夹中的 my.ini 文件中。

If this line is not found, then add it under [mysqld]

如果没有找到这一行,则将其添加到 [mysqld]

lower_case_table_names = 0

And then restart the wamp services, it will work :D

然后重新启动 wamp 服务,它会工作:D

回答by czLukasss

You must find file my.iniin your mysql folder and change, or add this line:

您必须在 mysql 文件夹中找到文件my.ini并进行更改,或添加以下行:

lower_case_table_names value = 0

回答by Andrey Frolov

It was not phpMyAdmin. MySQL did this.

它不是 phpMyAdmin。MySQL做到了这一点。

p.s. It is a bad practice to use camelCase in databases. Use _underlines instead. :)

ps 在数据库中使用camelCase 是一种不好的做法。请改用 _underlines。:)

回答by suresh

You need to find file my.ini in your mysql folder and change, or add this line at bottom:

您需要在 mysql 文件夹中找到文件 my.ini 并进行更改,或者在底部添加以下行:

lower_case_table_names = 2

lower_case_table_names = 2