Archive for the 'MySQL' Category

MySQL slow query log

The MySQL slow query log enables you to log all queries that take longer than a specified number of seconds to execute.  This should help identify any queries that are not performing sufficiently.
All that is required is two additional lines in the MySQL configuration file “my.cnf” in the [mysqld] section.
[mysqld]
log-slow-queries = /var/log/mysql-slow.log
long_query_time = 4
The above [...]

MySQL export to CSV

Saving the results of a MySQL query in a format that Excel can use

Creating a MySQL unicode UTF-8 database

Here’s the syntax for creating a UTF-8 database in MySQL as I can never remember it!
CREATE DATABASE `databasename` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;