我在ubuntu下,用gtk+ 和Mysql做开发
发现创建 数据库,和数据表的时候,不可以用中文名字,数字也不行,这是怎么回事呢
谢谢
我的系统是英文的,这个有关系不,我换成中文的后,数据库直接连不上

解决方案 »

  1.   

    用中文太不标准了 就像设置变量用abc一样
      

  2.   

    你好,我在做一个人员管理系统,想为每一个单位创建一个库,代码已经写完了,突然发现数据库名,数据表名不支持
    汉字,和全数字
    错误代码如下:(我在终端里的命令)mysql> create database 北京大学;
    ERROR 1064 (42000): You have an error in your SQL syntax; \
    check the manual that corresponds to your MySQL server version for the right syntax to use near '�京大学' at line 1mysql> create database ‘北京大学’;
    ERROR 1064 (42000): You have an error in your SQL syntax; \
    check the manual that corresponds to your MySQL server version for the right syntax to use near '北京大学’' at line 1
      

  3.   

    字符集问题
    set names gbk
    再输入SQL命令
    show variables like 'char%'; 
      

  4.   

    可以用中文,用 set names 'gbk' 或者 set names 'gb2312'; 设置字符集后,即可使用中文对象名。 
    但不推荐用中文做表名或字段名。