database

By Druss , 6 December, 2015

Edit: Skip this and scroll down for a proper fix!

Just tried installing MongoDB support for PHP on Kubuntu 15.10 via pecl and ran into the following error message which caused the installation to fail:

configure: error: Cannot find OpenSSL's libraries

While this can probably be fixed using some magickery, in my case, I did not want SSL support on a dev server. I just wanted to get the fucker up and running. To this end, I discovered that the issue was that I was using:

pecl install mongodb

By Druss , 2 April, 2015

Here I was simply creating a MySQL (5.5) table when suddenly up pops the following error:

#1071 - Specified key was too long; max key length is 767 bytes

After a little trial and error, I found that since one of my VARCHAR fields was being used for a UNIQUE index, MySQL was basically telling me that it was using too much space. When I reduced the length of this field from its initial 512 setting to 256 & then 255, it still complained. However, reducing it further to 128 fixed the issue!

By Druss , 23 April, 2013

While trying to edit a menu on a Drupal site, I found that none of my changes were being saved. Looking at the logs led me to the following error message:

PDOException: SQLSTATE[HY000]: General error: 144 Table 'cache_menu' is marked as crashed and last (automatic?) repair failed: DELETE FROM {cache_menu};

Simply restarting MySQL did not fix things and it looked like I had to get my hands a li'l dirty.

By Druss , 4 February, 2012

If you find that you Drupal installation is WSOD-dead with the following error message:

Error: Class 'SelectQueryExtender' not found in includes/pager.inc

then this means that you've messed up the Drupal (7, at the time of writing) registry somehow. You might have done this during an import/export operation where you forgot to export the registry and registry_file tables, or as I did, you have foolishly just emptied them to clear up issues with a missing class file that Drupal fastidiously continues to track.

By Druss , 22 September, 2011

While trying to import a CSV file into MySQL today using the LOAD DATA INFILE command, I ran into the following situation:

mysql> LOAD DATA INFILE 'foo.csv' INTO TABLE bar FIELDS TERMINATED BY ',' ENCLOSED BY '#' LINES TERMINATED BY '\r' (a, b);
ERROR 29 (HY000): File 'foo.csv' not found (Errcode: 13)

The file exists fine and the permissions are also kosher. After much gnashing of teeth and perusing of documentation, I found out that local file sources require the LOCAL keyword:

By Druss , 22 April, 2011

I installed MySQL on my local server today and when I went to access it via mysql_secure_installation to set my root password etc., I ran into the following curious error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

While I initially thought that it was some kind of installation issue, after much scratching of pate, I realised that Occam was right and that I should be checking the simpler things first. Sure enough, after a quick check, I found that MySQL was not even running :/

All times are UTC. All content licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.