列名和表名在MySQL中区分大小写吗? [英] Are column and table name case sensitive in MySQL?

查看:519
本文介绍了列名和表名在MySQL中区分大小写吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个名为category_idCategory_Id的列名,它们是否不同?

If I have a column names called category_id and Category_Id, are they different?

如果我有名为categoryCategory的表,它们是否不同?

And if I have table called category and Category, are they different?

推荐答案

在Unix上,表名区分大小写.在Windows上则不是.好玩,不是吗? Kinda喜欢他们各自的文件系统.你觉得这是巧合吗?

On Unix, table names are case sensitive. On Windows, they are not. Fun, isn't it? Kinda like their respective file systems. Do you think it's a coincidence?

换句话说,如果您打算在Linux机器上进行部署,那么也可以针对基于Linux的MySQL更好地测试SQL,或者在生产时为神秘的找不到表"错误做好准备.这些天虚拟机很便宜.

In other words, if you are planning on deploying on a Linux machine, better test your SQL against a Linux-based MySQL too, or be prepared for mysterious "table not found" errors at prod time. VMs are cheap these days.

字段(列)名称不区分大小写.

Field (column) names are case-insensitive regardless.

我们正在谈论的是MySQL 服务器计算机上的操作系统,而不是客户端.

we're talking about the operating system on the MySQL server machine, not client.

这篇关于列名和表名在MySQL中区分大小写吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆