I checked /var/log and /usr/local/mysql and i can't seem to find the log. I am trying to troubleshoot an error establishing a database connection with a php function.
|
|
As Chealion mentioned, there are several ways that your mysql could have been installed. Each of which will place your data dir and/or logs in different locations. The following command will give you (and us) a good indication of where to look.
Can you post the result of that command here please? Mine looks like this:
From that you can clearly see that my datadir is /opt/local/var/db/mysql (because I installed via MacPorts). Let's take this lesson a bit further... From the first line you can see the my daemon is /opt/local/libexec/mysqld. The mysqld can be called with --verbose --help to get a list of all command line options (and here is the important/valuable part!) followed by the values that would be used if you were launching mysqld instead of just check the help output. The values are the result of your compile time configuration, my.cnf file, and any command line options. I can exploit this feature to find out EXACTLY where my log files are, like so?
Mine looks like this:
LO AND BEHOLD! all of the advice in the world was not going to help me because my log file is kept in a completely non-standard location! I keep mine in /tmp/ because on my laptop, I don't care (actually I prefer) to loose all of my logs on reboot. Let's put it all together and make you a oneliner:
Execute that one command and you will get a list of all of the logs for your running instance of mysql. Enjoy! This Bash-Fu brought to you for free by my commitment to all things Open Source. |
||||
Source: MySQL Documentation You can use |
|||||
|
|
/Library/Logs/MySQL.log |
|||||
|
|
The folder holding that log may not be accessible to you without using
If you happen to find a large log file and when you're using Time Machine, you may want to read What is Time Machine doing? on Server Fault. |
|||
|
|
|
Took myself a while to find this... try this location:'
|
|||
|
|
|
Another way to find this information is to use
|
|||
|
|
