Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the location of mysql client ".my.cnf" in XAMPP for Windows?

What is the location of mysql client .my.cnf using XAMPP in Windows?

Clarification: This file does not exist by default, so when you create it, where should you place it, in order for the command line client to read it automatically?

like image 259
Alex R Avatar asked Nov 27 '10 17:11

Alex R


People also ask

How do you find which my CNF is being used?

d/mysql start 2>&1|grep my. cnf should show you the system call used to open the file.


2 Answers

Type this:

mysql --help  

Then look at the output. There is a block of text about 3/4 the way down describing what files it finds its defaults .my.cnf from. Here is an example from XAMPP v3.2.1:

Default options are read from the following files in the given order: C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf C:\xampp\mysql\my.ini C:\xampp\mysql\my.cnf C:\xampp\mysql\bin\my.ini C:\xampp\mysql\bin\my.cnf 

Your setup may differ. You will have to run the command to check the actual paths on your particular system.

like image 186
Billy Avatar answered Sep 28 '22 03:09

Billy


Look in the MySQL config file C:\xampp\mysql\bin\my.ini.

At the top of that file are some comments:

# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.

There it tells you where to find your .my.cnf file.

like image 24
Sudantha Avatar answered Sep 28 '22 05:09

Sudantha