Where can I find the MySQL log file in XAMPP
It's a *.err file.
You will find it here : C:\xampp\mysql\data
To trace you error correctly, open it with Notepad++ for example and Start Mysql. You Should see the error at the end of the file.
The accepted answer is a bit old, for MySQL 5.1+
you may use the queries:
SET GLOBAL general_log = 'ON';
SET GLOBAL general_log_file = 'my_log.log';
First will enable loging (which may be off by default)
and the second select updates the preferred file (by default under C:/xampp/mysql/data/).
NOTE: On windows 8 you may have to run your SQL IDE as ADMINISTRATOR for this commands to get saved.
NOTE2: you can also set this in the config, go to path_to_xampp/mysql/
and edit my.ini
(copy from my-default.ini if it does not exists) and add the settings there:
[mysqld]
general_log = 'ON';
general_log_file = 'my_log.log';
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
If you do
SHOW VARIABLES LIKE '%log_file%';
it will show exactly where they're being written.
You can also try looking at localhost/phpmyadmin/ and click on the Variables tab.