日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

MySQL 5.6.20-enterprise-commercial的参数文件位置问题

發(fā)布時(shí)間:2023/12/20 数据库 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySQL 5.6.20-enterprise-commercial的参数文件位置问题 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

今天在折騰MySQL的參數(shù)文件時(shí),突然發(fā)現(xiàn)MySQL 5.6.20-enterprise-commercial-advanced-log這個(gè)版本數(shù)據(jù)庫的參數(shù)文件my.cnf的位置有點(diǎn)奇怪,如下所示:

?

[root@DB-Server ~]# mysql --help | grep my.cnf????????????????????? order of preference, my.cnf, $MYSQL_TCP_PORT,/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf [root@DB-Server ~]# ls -lrt /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf ls: /etc/my.cnf: No such file or directoryls: /etc/mysql/my.cnf: No such file or directoryls: /usr/etc/my.cnf: No such file or directoryls: /root/.my.cnf: No such file or directory[root@DB-Server ~]# locate my.cnf/usr/my.cnf[root@DB-Server ~]# find / -name "my.cnf"/usr/my.cnf

?

?

?

我們知道MySQL啟動(dòng)的時(shí)候,會(huì)先去讀取參數(shù)文件my.cnf中的參數(shù)去初始化,默認(rèn)情況下,MySQL會(huì)按一定的順序來讀取參數(shù)文件,這個(gè)順序?yàn)?etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf? 但是,在這個(gè)MySQL版本中my.cnf 參數(shù)文件位于/usr/my.cnf下,Why? 一頭懵逼! 然后我測試了一下其它版本,例如mysql-community-server-5.7.18,確實(shí)都是位于指定的目錄,如下所示

?

?

[root@gettestlnx02 ~]# locate my.cnf????? /etc/my.cnf/etc/my.cnf.d[root@gettestlnx02 ~]# strace mysql ";" 2>&1 | grep my.cnfstat64("/etc/my.cnf", {st_mode=S_IFREG|0644, st_size=979, ...}) = 0open("/etc/my.cnf", O_RDONLY|O_LARGEFILE) = 3stat64("/etc/mysql/my.cnf", 0xffc0f4a0) = -1 ENOENT (No such file or directory)stat64("/usr/etc/my.cnf", 0xffc0f4a0)?? = -1 ENOENT (No such file or directory)stat64("/root/.my.cnf", 0xffc0f4a0)???? = -1 ENOENT (No such file or directory)[root@gettestlnx02 ~]#? rpm -qf? /etc/my.cnfmysql-community-server-5.7.18-1.el6.i686[root@gettestlnx02 ~]#

?

?

?

?

后面搜索了一下,發(fā)現(xiàn)這居然是一個(gè)bug來著。具體參考下面鏈接

?

https://bugs.mysql.com/bug.php?id=68318

https://bugs.mysql.com/bug.php?id=71600

?

With recent MySQL 5.6 versions, the RPM installation generate a non-standard /usr/my.cnf file overriding the sql_mode set in /etc/my.cnf as per:?https://bugs.mysql.com/bug.php?id=71600

This occurs during upcp when minor MySQL updates are installed and breaks some sites due to "STRICT_TRANS_TABLES".

Please add the flag --keep-my-cnf when executing mysql_install_db or otherwise remove the /usr/my.cnf file after MySQL upgrade during upcp to remove this unexpected change.

?

?

?

參考資料:

?

https://features.cpanel.net/topic/disable-creation-of-usrmy-cnf-when-mysql-is-installed

https://bugs.mysql.com/bug.php?id=71600

轉(zhuǎn)載于:https://www.cnblogs.com/kerrycode/p/7205590.html

總結(jié)

以上是生活随笔為你收集整理的MySQL 5.6.20-enterprise-commercial的参数文件位置问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。