分页: 1 / 1

请问为何会出现这个错误?另外请问怎么改字符编码?

发表于 : 2009-06-23 13:03
2008Lenovo
screenshot_001.jpeg
root@lenovo-laptop:~# mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 79
Server version: 5.0.75-0ubuntu10.2 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> >show variables like 'character%';
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 '>show variables like 'character%'' at line 1
上面这个错误是为什么?
另外我想让mysql默认使用gb2312(或者其他的中文)的编码怎么做?

Re: 请问为何会出现这个错误?另外请问怎么改字符编码?

发表于 : 2009-06-23 13:08
eexpress
难道这是sql命令???
:em04

Re: 请问为何会出现这个错误?另外请问怎么改字符编码?

发表于 : 2009-06-23 13:13
2008Lenovo
哦,错了!资料上错了!其实是show variables like '%char%';

请问怎么让mysql默认使用gb2312(或者其他的中文)的编码怎么做?
screenshot_002.jpeg

Re: 请问为何会出现这个错误?另外请问怎么改字符编码?

发表于 : 2009-07-02 8:16
ncowboy
/etc/my.cnf
[mysqld]
default-character-set = XXXXX
default-collation = XXXXX
character_set_server = XXXXX

请参考http://dev.mysql.com/doc/refman/5.0/en/option-files.html