mysql

By Druss , 8 May, 2012

After my upgrade from Lucid to Precise (and thereby, from MySQL 5.1 to 5.5), I found that my MySQL instance was not running. When I tried to start the service all I got back was that it had failed to start.

I checked the system log (sudo tail /var/log/syslog) to see if I could divine the cause of this issue and I found the following messages:
init: mysql post-start process (5075) terminated with status 1
mysql respawning too fast, stopped

By Druss , 9 December, 2011

If you find that the really handy Excel spreadsheet import feature for MySQL is missing in PHPMyAdmin, it's because it has been removed. According to the PHPMyAdmin changelog:
3.4.5.0 (2011-09-14)
- [core] Remove library PHPExcel, due to license issues
- [export] Remove native Excel export modules (xls and xlsx formats)
- [import] Remove native Excel import modules (xls and xlsx formats)

By Druss , 6 December, 2011

If you're importing Open Office / Libre Office Calc files or Excel spreadsheets into MySQL using PHPMyAdmin, you might have run into the occasional case where the process hangs with either a partially imported set or no records at all. After some messing around, I have found that this usually happens when there's a problem with the input data. In my case, this usually stemmed from duplicate primary keys or similar issues. Unique keys were detected fine.

In other words, PEBKAC.

By Druss , 27 September, 2011

Earlier today, I was banging my head against the wall trying to import some data in a CSV file into MySQL. While my imports have gone well thus far, this time around I was dealing with data involving lots of strange diacritics, runic squiggles and other manners of gibberish that make the world as fun as it can be. In other words, I was dealing with Unicode.

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.