Category
Karmic MySQL Server Problem Fixed
The Karmic upgrade went really well but MySQL server seemed to die along the way. A temporary solution that worked for me was found here – http://ubuntuforums.org/showthread.php?t=1040786. sudo apt-get remove –purge mysql-server-5.1 sudo apt-get autoremove sudo rm -rf /etc/mysql sudo apt-get install mysql-server-5.1 [update] This solution doesn’t persist after reboot (at present). Still useful if [...]
Slow query yet indexed – collation mismatch on index?
I had a simple query with 3 tables linked with one inner and one left join. Ran indescribably slowly – unless I changed the left join to an inner join (which I didn’t want to do). Yet all the links were indexed. EXPLAIN showed that the indexes were not being used. Why? Answer – one [...]
Reset MySQL password in Ubuntu
A fresh install didn’t seem to let me set/reset the password and for some reason I couldn’t get in. So thanks to: http://ubuntu.flowconsult.at/en/mysql-set-change-reset-root-password/ for the answer (which worked in Hardy): 1. Stop the MySQL Server sudo /etc/init.d/mysql stop 2. Start the mysqld configuration. sudo mysqld –skip-grant-tables & 3. Login to MySQL as root. mysql -u [...]
Kexi review (Access bruiser but not Access Killer yet)
After my disappointing experiences with OpenOffice Base last year I was worried that Kexi wouldn’t be much good. But it was – within its limits. The interface seemed excellent and intuitive and even though it wasn’t anywhere near as familiar to me as the Access interface (many thousands of hours) I found myself getting quite [...]
Sluggish MySQL because of ContentProtect
A program I wrote using python and MySQL ran much, much slower on my development computer than on the client’s computer. And their computer seemed about the same spec as mine. I upgraded from python 2.4 to 2.5. Nope. Was it the RAM. Nope – they had half a Gb to my 1Gb. Was it [...]
Collation in MySQL CONCAT function
This simple concat expression works in MySQL 4.1.21-standard: select CONCAT(DATE_FORMAT(dtmTest,”%Y-%m-%d”), ” – “, strType) FROM tbltest but not in MySQL 5.0.45-community-nt: Error Code : 1270 Illegal mix of collations (utf8_general_ci,COERCIBLE), (utf8_general_ci,COERCIBLE), (latin1_swedish_ci,IMPLICIT) for operation ‘concat’ (0 ms taken) Solution: use COLLATE thus: select CONCAT(DATE_FORMAT(dtmTest,”%Y-%m-%d”), ” – ” COLLATE utf8_general_ci, strType) FROM tbltest; This is relevant: [...]
Running MySQL scripts (.sql files) from python
This should have been more obvious. All I wanted was to run a simple script e.g. myscript.sql in MySQL from python in Windows. Some things worked fine from the DOS prompt but failed from within python (and RUN for that matter). Here is the answer in the form of a simple function (NB to get [...]