character-set-server和mysql的配置文件

时间:2012-11-25 15:44:40

标签: mysql utf-8

我正在运行mysql -u root -p(在Ubuntu 12.05上),我继续收到此错误消息:

mysql: unknown variable 'character-set-server=utf8'

确实在我的my.cnf文件中进行了设置,因为我在设置default-set-server=utf8时发生了一条消息,现在已弃用。这是我的my.cnf文件:

[client]
  port            = 3306
  socket          = /var/run/mysqld/mysqld.sock
  character-set-server = utf8
[mysqld]
  #
  # * Basic Settings
  #
  user            = mysql
  pid-file        = /var/run/mysqld/mysqld.pid
  socket          = /var/run/mysqld/mysqld.sock
  port            = 3306
  basedir         = /usr
  datadir         = /var/lib/mysql
  tmpdir          = /tmp
  skip-external-locking
  collation-server = utf8_unicode_ci
  character-set-server = utf8
  init-connect='SET NAMES utf8'

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

您需要删除character-set-server = utf8下已有的[mysqld]客户端,并确保在更改cnf文件后重新启动SID