Cheapest MySQL database hosting for a hobby project?

If you search for cheapest mysql database, you will get results on Reddit, where the most common advice is to get a Digital Ocean VPS for $5/mo. Cheapest mySQL hosting? Which is the cheapest MySQL hosting in cloud? Cheap database hosting for hobbyist? While $5/mo. is kind of cheap, it’s not the cheapest. Here are… Continue reading Cheapest MySQL database hosting for a hobby project?

Forcing mysqldump to _really_ skip comments

I wanted to do a diff on two database structures, and one answer suggested running mysqldump on both databases and then doing diff on the resulting scripts. The problem is that comments will clutter the output and get in the way, and even explicit –compact, –skip-comments, –skip-set-charset etc. won’t help. You will still be getting… Continue reading Forcing mysqldump to _really_ skip comments

Non-destructive duplicate removal from a MySQL table

Create a new table CREATE TABLE records_new LIKE records; Add composite UNIQUE constraint preventing duplicates in the future ALTER TABLE records_new ADD UNIQUE idx_composite_UNIQUE (site_id ASC, session_id ASC, query ASC, remote_addr ASC); Copy records over. INSERT INTO records_new SELECT * FROM records ORDER BY id ON DUPLICATE KEY UPDATE records_new.created=NOW(); The above updates created to… Continue reading Non-destructive duplicate removal from a MySQL table

Changing a MySQL/MariaDB variable in my.cnf has no effect?

The MySQL/MariaDB Server settings tweaked in /etc/mysql/my.cnf will go live only after you restart it – but sometimes a simple service mysql restart just won’t do it. Instead, try: service mysql reload service mysql stop service mysql start If there’s some e.g. unrelated error in your config, restart will actually do nothing (apparently to ensure… Continue reading Changing a MySQL/MariaDB variable in my.cnf has no effect?