返回顶部
首页 > 资讯 > 数据库 >mysql启动报错之[ERROR] Found option without preceding group in config file /etc/my.cnf at line
  • 413
分享到

mysql启动报错之[ERROR] Found option without preceding group in config file /etc/my.cnf at line

mysqllinux 2023-10-11 14:10:07 413人浏览 八月长安
摘要

今天碰到一个特别郁闷的问题,启动Mysql数据库时报错:[ERROR] Found option without preceding group in config file /etc/my.cnf

今天碰到一个特别郁闷的问题,启动Mysql数据库时报错:[ERROR] Found option without preceding group in config file /etc/my.cnf at line 7!
我进行了以下几步进行了排除检查

my.cnf文件编码格式的调整

notepad++保存文件确保编码使用utf-8
2、安装dos2unix并进行转换

yum install dos2unixdos2unix /etc/my.cnf

vim编辑文件底部显示[converted],vim编辑时输入以下内容

:set fileencoding=utf-8

然后保存
然而这三种方法都解决不了

调整my.cnf内容

之前datadir前面是没有[mysqld]的,后面发现调整了[mysqld]才顺利解决了

[mysqld]datadir=/opt/mysql/dataSocket=/var/lib/mysql/mysql.sock# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0log-error=/opt/mysql/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pidsql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONinnodb_buffer_pool_size = 10Ginnodb_log_buffer_size = 16M#innodb_max_dirty_pages_pct = 80innodb_flush_log_at_trx_commit=0innodb_log_file_size = 256Minnodb_buffer_pool_instances = 12innodb_purge_threads = 12innodb_flush_method=O_DIRECT#innodb_use_sys_malloc = 0innodb_read_io_threads=12innodb_write_io_threads=12#innodb_old_blocks_time=1000preload_buffer_size=1Gthread_cache_size = 1024query_cache_type=1query_cache_size= 64Mmax_connections = 100000table_open_cache = 1024#table_cache_size = 1024table_definition_cache = 1024tmp_table_size = 256Mmax_heap_table_size = 300Mbinlog_cache_size = 4Mthread_stack = 512Kread_buffer_size = 4Mkey_buffer_size = 64M#myisam_sort_buffer_size = 64Mjoin_buffer_size = 128Msort_buffer_size = 64Mread_rnd_buffer_size = 64Minnodb_page_size=8K#collation_server=utf8mb4_general_ci#innodb_file_fORMat=BARRACUDA#innodb_file_per_table = ON#innodb_large_prefix=1#default-character-set= utf8mb4character-set-server = utf8innodb_large_prefix=on#collation-server = utf8mb4_unicode_ci# [mysql]

来源地址:https://blog.csdn.net/sinat_32188225/article/details/124199352

您可能感兴趣的文档:

--结束END--

本文标题: mysql启动报错之[ERROR] Found option without preceding group in config file /etc/my.cnf at line

本文链接: https://lsjlt.com/news/428368.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作