7

我正在运行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'

有人可以帮忙吗?

4

1 回答 1

3

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

于 2014-04-25T18:25:39.417 回答