Smokes your problems, coughs fresh air.

Tag: MySQL (Page 3 of 3)

Images not showing after upgrade to MediaWiki 1.13

When I upgraded two of my MediaWiki installations[1, 2] a while ago, images were no longer being displayed. I found out that this was due to some problem with a change to the image.image_name column.

Gladly, the fix was easy (adopted from the message in the mailing list):

ALTER TABLE image ADD COLUMN img_name2 varchar(255); 
UPDATE image SET img_name2=img_name;
UPDATE image SET img_name=img_name2;
ALTER TABLE image DROP COLUMN img_name2;

Purging a MySQL database without losing meta data

When I clone a production database to a development database, I always need to empty the development database first. I could never find an SQL command to completely purge a database, bur, recently, I learned something about MySQL that surprised me: MySQL doesn’t lose the user rights for a database when you drop it. So, purging a MySQL database (without losing any access data meta data about that DB) is as simple as issuing the following statements:

DROP DATABASE my_development_db;
CREATE DATABASE my_development_db;

Happy cloning! 🙂

Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑