Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is MySQL 5.7 my.cnf file?

In Ubuntu I had my.cnf file of MySQL 5.6 in /etc/my.cnf. But I can't find the same file of MySQL 5.7. From where can I find that?

I did a find in entire / (root). But I couldn't find it anywhere. Any clues?

I'm trying to set max_connections value.

like image 294
Bee Avatar asked Jul 20 '16 21:07

Bee


People also ask

Where is my CNF file in MySQL?

cnf is located in /etc/mysql/my. cnf .

Where is my CNF file in MySQL in Windows?

C:\Program Files\MySQL\MySQL Server 5.5\my. ini C:\Program Files\MySQL\MySQL Server 5.5\my. cnf.

How do I know my CNF file?

strace -fe open /etc/init. d/mysql start 2>&1|grep my. cnf should show you the system call used to open the file. Save this answer.


2 Answers

In MySQL 5.7, the default cnf is at:

/etc/mysql/mysql.conf.d/mysqld.cnf
like image 118
neobie Avatar answered Oct 22 '22 07:10

neobie


mysql --help printed below.

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file,
                        except for login file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
--defaults-group-suffix=#
                        Also read groups with concat(group, suffix)
--login-path=#          Read this path from the login file.
like image 13
Bee Avatar answered Oct 22 '22 06:10

Bee