The MySQL config file /etc/my.cnf was not found on your system. Use the module configuration page to set the correct path

Operating system:
OS version:
The MySQL config file /etc/my.cnf was not found on your system. Use the module configuration page to set the correct path.

Unable to access my DB showing like that and website I am getting this error CDbException

CDbConnection failed to open the DB connection.

Kindly advice me

Hello @natarajmohandoss and welcome to the community.

To begin with, you are expected to enter the Operating system and OS version before you ask for help. Your doing so enables the community to respond meaningfully. Could you edit your original message to include this info please?

In this particular instance it is obvious that at least one important configuration file is missing from your system. Could you also let us know a bit more about your system - did you perform any major operations / updates / restores before the advent of this issue?

Dear Sir,

Thanks for your reply my os version is CentOS Linux 7.8.2003 I have an issue with connecting DB it’s normal working last 20days no problem suddenly I got this problem DB not connecting refer the below URL for error
URL:https://ibb.co/zRhC2w8
URL:https://ibb.co/r2pWHgG
Kindly give the sollution.

OK: the problem of ‘DB not connecting’ is due to a missing configuration file, namely /etc/my.cnf. Due to this missing file, MySQL is down / offline and so you are seeing errors in the frontend such as CDbException.

You say that you have not performed any major installs / updates / restores and the system was running fine for 20 days after which it suddenly threw this error: in this situation, let us treat the problem symptomatically and place the file my.cnf where it is expected to be found. Could you restore my.cnf from a backup or if you do not have a backup, create my.cnf from the snippet below:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

symbolic-links=0
innodb_file_per_table = 1





[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid




!includedir /etc/my.cnf.d

Place it in the /etc directory with owner root 0644 and let us know if MySQL comes up.

Dear Sir,

Thankyou very much sir and please share me why this problem is coming before also we are facing same problem after 6day i am getting same problem.

Hmm, so we can conclude that your your problem is caused by a my.cnf file which goes AWOL every few days.

No, @natarajmohandoss, I am unable to guess why that might happen. If others in the community have an insight, they might post but you now know what to do to address the problem should it occur again. That’s it from me.

How did you install Webmin/Virtualmin? Did you use Virtualmin official install.sh script? Did you run by any chance setup.sh manually from Webmin directory?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.