MySQL:无法以大驼峰命名法(帕斯卡命名法)为表命名

发布于 2024-10-05 19:10:09 字数 166 浏览 0 评论 0原文

我读到,最好的做法是使用帕斯卡命名法(ThisIsMyTableName)来命名表。 因此我想更改 MySQL 中的表。但 phpmyadmin 和 SQL Manager 2005 for MySQL 都不会让我这样做。名字仍然以小写形式出现,就好像我根本没有改变一样。

有什么建议来解决这个问题吗?

I read that it is best practise to have table names in Pascal Case (ThisIsMyTableName).
Therefor I would like to change my tables in MySQL. But neither phpmyadmin, nore SQL Manager 2005 for MySQL will let me. The names stay to appear in lowercase, as if I didn't to a change at all.

Any suggestions to solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

记忆里有你的影子 2024-10-12 19:10:09

处理此问题的最简单方法是将以下内容添加到 .ini 文件中

lower_case_table_names=2

2 这对 Windows 来说很重要。您可以在这里阅读更多相关信息标识符区分大小写

The easiest way to take care of this is to add the following to your .ini file

lower_case_table_names=2

2 is the significance here for Windows. You can read more about it here Identifier Case Sensitivity

预谋 2024-10-12 19:10:09

由于区分大小写的问题,我建议不要混合大小写。在一个无关紧要的平台上经过全面测试的解决方案在部署到一个重要的平台上时实际上可能会失败。仅出于这个原因,我建议坚持全部大写或全部小写。
我使用小写字母是因为它更容易被眼睛看到,并且在大多数编辑器中使用的固定宽度字体中更容易发现拼写错误。

I advice against mixed case because of problems with case sensitivity. A fully tested solution on one platform where case doesn't matter may actually fail when deployed on a platform where case DOES matter. For that reason alone I suggest sticking with either all caps or all lower case.
I use lower case because it is easier on the eye and make spelling errors easier to spot in fixed width fonts used in most editors.

鲸落 2024-10-12 19:10:09

使用 RENAME

示例:

RENAME TABLE this_is_my_table_name TO ThisIsMyTableName;

详细信息:http: //dev.mysql.com/doc/refman/5.1/en/rename-table.html

Use RENAME

example:

RENAME TABLE this_is_my_table_name TO ThisIsMyTableName;

details : http://dev.mysql.com/doc/refman/5.1/en/rename-table.html

与之呼应 2024-10-12 19:10:09

在 MySQL 中,您可以在任何地方引用表名来使它们保留大小写且敏感。

`MyTableName`

In MySQL, you can quote the table names everywhere to make them case preserving and sensitive.

`MyTableName`
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文