MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 6723|回复: 7
打印 上一主题 下一主题

mysql数据库名大小写问题

[复制链接]
milywang 该用户已被删除
跳转到指定楼层
1#
发表于 2008-8-31 15:48:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
发表于 2008-9-1 10:24:05 | 只看该作者
不应该呀,在Windows系统下,大小写不敏感,SCHEMA_NAME在此处相当与文件系统中的一个文件夹,而Windows不要求大小写,SCHEMA_NAME与schema_name在Windows中被认为是一个文件夹的...

我访问了个表试了试
select * from MYSQL.user;
select * from mysql.user;
效果一样!

难道访问函数会不一样?再检查一下你的脚本是否写正确...
milywang 该用户已被删除
3#
 楼主| 发表于 2008-9-1 19:25:04 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
4#
发表于 2008-9-1 19:28:34 | 只看该作者
把你创建函数的脚本发出来,我也试试看...
5#
发表于 2008-9-1 19:32:54 | 只看该作者
哦,明白是什么原因了,函数是存储在MySQL数据库的信息库中,保存的时候就已经标注了属于那个数据库的函数了。而不是存在磁盘上,与OS文件无关,所以就要求大小写区分了。
milywang 该用户已被删除
6#
 楼主| 发表于 2008-9-2 15:22:19 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
7#
发表于 2008-9-2 15:32:43 | 只看该作者
是要在my.cnf里设置:
lower_case_table_names=1

让MySQL实现不区分大小写吧,让你无论大小写都能访问...
8#
发表于 2008-9-2 15:57:21 | 只看该作者
多说一句,这个问题又转回来了

默认值,Windows中就是不区分大小写:
On Unix, the default value of lower_case_table_names is 0. On Windows the default value is 1. On Mac OS X, the default value is 2.

ValueMeaning
0Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are case sensitive. Note that if you force this variable to 0 with --lower-case-table-names=0 on a case-insensitive filesystem and access MyISAM tablenames using different lettercases, index corruption may result.
1Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases.
2Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on filesystems that are not case sensitive! InnoDB table names are stored in lowercase, as for lower_case_table_names=1.



原帖由 kider 于 2008-9-1 19:32 发表
哦,明白是什么原因了,函数是存储在MySQL数据库的信息库中,保存的时候就已经标注了属于那个数据库的函数了。而不是存在磁盘上,与OS文件无关,所以就要求大小写区分了。


所以,你还是需要在函数应用中,需要注意数据库名的大小写。不能大小写混用。或许就是MySQL的一个需要改进的地方或BUG...
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-5-25 04:17 , Processed in 0.100443 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表