Default Mysql Mysqld Config File
The /etc/my.cnf file is the main MySQL configuration file. It sets the default MySQL database location and other needed parameters. Usually you don’t have to edit this file, but if you do here’s more info:
This how a basic default mysql configuration file looks like:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.
sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=mysql
basedir=/var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
I’m mostly sure this could be different by distribution, but in most cases the options below will work ok and its location will be under etc directory in root.