MySQL my.cnf文件-找到的选项没有前面的组 [英] MySQL my.cnf file - Found option without preceding group

查看:117
本文介绍了MySQL my.cnf文件-找到的选项没有前面的组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试远程连接到Ubuntu中的数据库,但是尝试mysql -u root -p时却收到错误消息:

I'm trying to connect to my DB in Ubuntu remotely but I receive error message when trying to mysql -u root -p:

在配置文件:/etc/mysql/my.cnf的第1行找到了没有前一组的选项

Found option without preceding group in config file: /etc/mysql/my.cnf at line: 1

my.cnf如下:

[mysqld]
user        = mysql
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
bind-address        =  0.0.0.0
key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
query_cache_limit   = 1M
query_cache_size        = 16M
log_error                = /var/log/mysql/error.log
expire_logs_days    = 10
max_binlog_size         = 100M

[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[mysql]

[isamchk]
key_buffer      = 16M

推荐答案

字符集编码

检查文件的字符集编码.确保它是ASCII码.

Charset encoding

Check the charset encoding of the file. Make sure that it is in ASCII.

例如,使用od命令查看开头是否有UTF-8 BOM.

Use the od command to see if there is a UTF-8 BOM at the beginning, for example.

这篇关于MySQL my.cnf文件-找到的选项没有前面的组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆