本篇内容主要讲解“怎么解决mysql中unknown variable 'defaults-file问题”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么解决mysql中unknown variable 'defaults-file问题”吧!
初始化 percona server 5.7 的时候
一定要把默认的 /etc/my.cnf mv 掉 否则一直优先按照默认配置进行参数读取
报错如下:
[root@fund-mgmt-db-mog-2 ~]# /home/mysql/mysql/bin/mysqld –initialize –user=mysql –defaults-file=/home/mysql/my3310.cnf –basedir=/home/mysql/mysql –datadir=/home/mysql/my3310/data
2016-11-21T02:44:43.017602Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2016-11-21T02:44:43.179291Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-11-21T02:44:43.214156Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-11-21T02:44:43.267368Z 0 [ERROR] unknown variable 'defaults-file=/home/mysql/my3310.cnf'
2016-11-21T02:44:43.267390Z 0 [ERROR] Aborting
解决办法: 调整一下参数顺序就好了
[root@fund-mgmt-db-mog-2 ~]# /home/mysql/mysql/bin/mysqld –defaults-file=/home/mysql/my3310.cnf –initialize –user=mysql –basedir=/home/mysql/mysql –datadir=/home/mysql/my3310/data
到此,相信大家对“怎么解决mysql中unknown variable 'defaults-file问题”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/202287.html