今天碰到一个特别郁闷的问题,启动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!
我进行了以下几步进行了排除检查
notepad++保存文件确保编码使用utf-8
2、安装dos2unix并进行转换
yum install dos2unixdos2unix /etc/my.cnf
vim编辑文件底部显示[converted],vim编辑时输入以下内容
:set fileencoding=utf-8
然后保存
然而这三种方法都解决不了
之前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
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0