Articles in the MySQL Category
debian, MySQL »

I completed an upgrade of Debian Lenny to Squeeze on a production database server over the weekend. It went quite well and I had zero downtime thanks to my secondary database servers running in-place. One of the biggest benefits to running Squeeze is that MySQL runs at version 5.1.49. Lenny only supports up to MySQL 5.0.
Row-based-replication is safer to replicate data to other servers since all changes are replicated. Prior to MySQL 5.1.14, updates to the mySQL database were not replicated. They were updated via statements (e.g. GRANT, REVOKE). This can potentially cause data-consistency between the master and …
MySQL, PHP »
If you ever have the need to find the answer to the following:
- What are the number of tables in a MySQL database?
- What are the number of rows in a MySQL database?
- How much space is the MySQL database using up on the server?
- How many tables there are in a MySQL server?
- How many rows there are in a MySQL server?
One of the quickest ways to find out MySQL reporting stats is using PHPMyAdmin. The software is usually installed on a number of servers by default, so its just a matter of locating where in the program to find this info.
This is an example of what the stats look …
debian, Linux, MySQL »
The quickest way to disable autostart of services in Debian is to utilize a convenient curses interface to selectively choose which services to autostart in different run levels. Its so much easier to use than update-rc.d. Its good for instances where you are migrating services out of an existing box, such as removing the mysql server without uninstalling.
The package is called:
sysv-rc-conf
(Install it using aptitude or apt-get install)
MySQL, PHP »
The error message looked like:
“Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation ‘find_in_set’”
I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to “latin1_swedish_ci” character set.
The fix?
I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to “utf8_general_ci
MySQL »
MySQL by default will make the ORDER BY option in queries case sensitive. This means that rows with the same starting letters (but different case) may be ordered non-alphabetically. There are three solutions to this. One is to force all database entries to be forced to upper-case or lower-case when inserting. Another is to use the collate option. The other solution is to change the query itself.
