more on MySQL
William (183 points) | Wed, 2005-09-21 12:29Following on from yesterday's tip about MySQL, I thought I should mention a few tips for working with MySQL.
1 - A great MySQL admin tool, from MySQL.com, MySQL Administrator. This lets you stop/start and manage all aspects of the server. eg to enable query logging.

2 - In the development stages enable query logging and run a tail. This allows you to see exactly what is being sent to the server, and is a great tool when debugging.
Go download and install the MySQL Admin tool...
To enable logging go to Options -> Log Files -> Pencil icon and enter a file name
eg: /usr/local/mysql/data/query.log
Stop and Start the server.
Now in the terminal type:
sudo tail -f /usr/local/mysql/data/query.log
Now any time a query is made against the MySQL Database, it wil be logged here.

You could of course enable logging by editing the file /etc/my.conf, however many people find this simpler.
- William's blog
- Login or register to post comments






You know, I looked and looked at the MySQL Administrator page the other day and couldn't find a download link/page anywhere, so I kind of assumed it was a commercial product and that they didn't want to say so until you'd decided that this was something you really wanted. I never thought to look under the "Related pages" heading. What a stupid place to put it. It should be right there on the first "Overview" page!
All in all I find the MySQL overly complex and difficult to navigate.
http://www.travholt.net/
...I use phpMyAdmin and php to echo my queries, to see if something is wrong with them.
It looks like a cool program, but I wouldn't download it and install it just because it can help me in database debugging.
Any other cool features it has?
The reason you would want to enable the query logging was if you weren't sure what query was being sent to the database. If you just want to run queries it would be quickest to use the mysql console.
However if you are generating your queries on the fly with PHP, and something is not working as expected, this can be helpful to see what queries are being generated.
--
http://www.macscan.net/
I agree with William. You need logging also to debug which of your queries are slow so you can think of better ways of optimising them.
I read HERE that installing Adobe Version Cue will make a mess of your existing MySQL installation, anybody know about this? Ways to work around it or patches available?
Thanks!
This is entirely possible, though I had never heard of this happening.
You could run your database on a different port, or even better, run it wth networking disabled. You would then connect to a different socket.
I don't have any Adobe products installed, so can't test, however if you want I could have a look at your machine.
Send me an email if you want me to have a look. If there is a conflict then i could write another article about this problem. Just need SSH access.
Will
--
http://www.macscan.net/
Thanks Will, I dont have Adobe CS too! I'm just a worry wart ...
I guess if you are going to install Adobe Version Vue on a system that has MySQL, one precaution is to first backup your existing MySQL databases ...