Mysql Upgrade – left joins not working?

If you are getting an error like:

Unknown column ‘i.blah’ in ‘on clause’

using a left join like:

FROM items_table AS items, meta_data_table AS md, categories_table AS cat LEFT JOIN restricted_table AS rst ON items.item_id=rst.item_id WHERE items.title LIKE ‘the%’

switch the order of the from around so that the item MySQL is complaining about is at the end of the from clause. That should fix it in many cases.

So you’ve got a mysql server with an unknown number of isam tables and you need to convert them (the easy way)? Here’s how:

find /var/lib/mysql/ -name “*.ISM” -print > convert.txt

emacs convert.txt

replace: “/var/lib/mysql/” with “alter table “

replace “.ISM” with ” type = myisam;”

replace “/” with “.”

Be careful to include the spaces where I have them.

The run:

mysql -u root -p < convert.txt