MySQL将每个数据库映射一个MySQL数据目录下面的目录,将数据库表映射到数据库目录下的数据库文件名。这有2个含意: 
在区分大小写文件名的操作系统(象大多数 Unix 系统一样)上的MySQL中数据库名字和表名是区分大小写的。
如果你有困难记得表名,接受一个一致的约定,例如总是用小写名字创建数据库和表。 数据库、表、索引、列或别名可以以数字开始(但是不能仅由数字组成)。★ 
你可以使用标准的系统命令备份、重命名、移动、删除和拷贝表。例如,重命名一个表,重命名“.MYD”、“.MYI”和“.frm”文件为相应的表。下列词明确地在MySQL中被保留。他们的大多数被 ANSI SQL92 禁止作为列或表名(例如,group)。一些被保留因为MySQL需要他们并且正在(当前)使用一个yacc分析器: action  add  aggregate  all  
alter  after  and  as  
asc  avg  avg_row_length  auto_increment  
between  bigint  bit  binary  
blob  bool  both  by  
cascade  case  char  character  
change  check  checksum  column  
columns  comment  constraint  create  
cross  current_date  current_time  current_timestamp  
data  database  databases  date  
datetime  day  day_hour  day_minute  
day_second  dayofmonth  dayofweek  dayofyear  
dec  decimal  default  delayed  
delay_key_write  delete  desc  describe  
distinct  distinctrow  double  drop  
end  else  escape  escaped  
enclosed  enum  explain  exists  
fields  file  first  float  
float4  float8  flush  foreign  
from  for  full  function  
global  grant  grants  group  
having  heap  high_priority  hour  
hour_minute  hour_second  hosts  identified  
ignore  in  index  infile  
inner  insert  insert_id  int  
integer  interval  int1  int2  
int3  int4  int8  into  
if  is  isam  join  
key  keys  kill  last_insert_id  
leading  left  length  like  
lines  limit  load  local  
lock  logs  long  longblob  
longtext  low_priority  max  max_rows  
match  mediumblob  mediumtext  mediumint  
middleint  min_rows  minute  minute_second  
modify  month  monthname  myisam  
natural  numeric  no  not  
null  on  optimize  option  
optionally  or  order  outer  
outfile  pack_keys  partial  password  
precision  primary  procedure  process  
processlist  privileges  read  real  
references  reload  regexp  rename  
replace  restrict  returns  revoke  
rlike  row  rows  second  
select  set  show  shutdown  
smallint  soname  sql_big_tables  sql_big_selects  
sql_low_priority_updates  sql_log_off  sql_log_update  sql_select_limit  
sql_small_result  sql_big_result  sql_warnings  straight_join  
starting  status  string  table  
tables  temporary  terminated  text  
then  time  timestamp  tinyblob  
tinytext  tinyint  trailing  to  
type  use  using  unique  
unlock  unsigned  update  usage  
values  varchar  variables  varying  
varbinary  with  write  when  
where  year  year_month  zerofill  下列符号(来自上表)被ANSI SQL禁止但是被MySQL允许作为列/表名。这是因为这些名字的一些是很自然的名字并且很多人已经使用了他们。 ACTION 
BIT 
DATE 
ENUM 
NO 
TEXT 
TIME 
TIMESTAMP 

解决方案 »

  1.   

    至于中文表名与中文表字段的表示,
    我也不能给一个确定的说法,
    我目前也在尝试,
    在WIN9x、WINNT系统上
    至少还没发现什么问题
      

  2.   

    操作系统对数据库和表命名的限制
    MySQL对命名数据库和表有一个原则: 名字可以由当前字符集中的任何字母数字字符组成,下划线和美元符$也可以。 
    名字最长为64个字符。 
    然而,因为数据库和表的名字对应于目录和文件名,服务器运行的操作系统可能强加额外的限制。首先,数据库和表名仅限于对文件名合法的字符,如$在MySQL的原则中是允许的,但是如果你的操作系统不允许,则你不能在目录或表名中使用它。实际上,这对Unix或Windows不是所担心的,最大的难度是在执行数据库管理时直接在shell中引用名字,例如,如果你命名一个数据库如$my_db,包含一个美元符,任何从shell中对该名字的引用可能被shell解释为对一个变量的引用:%ls $my_db
    my_db:undefined variable对此,你必须转义$字符或用引号禁止其特殊含义:%ls \$my_db
    %ls '$my_db'如果你用引号,一定要用单引号,而双引号并不禁止变量解释。其次,虽然MySQL允许数据库和表名最长到64个字符,但名字的长度受限于你的操作系统限定的长度,一般这不是一个问题(虽然老的System V强制14个字符)。在这种情况下,你数据库名的上限为14个字符,而表名上限为10个字符,因为表示表的文件名有一个点(.)和三个字符的扩展名。第三,文件系统的大小写敏感性影响到你如何命名和引用数据库和表名。如果文件系统是大小写敏感的(如Unix),两个名字my_tbl和MY_TBL是不同的表。如果文件系统不是大小写敏感的(如Windows),这两个名字指的是相同的表。如果你用一个Unix服务器开发数据库,并且如果你有可能转移到Windows,你应该记住这一点。