I’ve known about MariaDB for a while, but because I wanted my development machines to match my production environments, I just stayed with MySQL. Today I found out that the production environments switched to MariaDB, so I searched around the internet to find out how to do the switch on my development machines. All are running Ubuntu 14.04, so I thought that as long as I could do it on one, it would be easy to do the rest. Well, that would be the case if there were good instructions somewhere, but I had to piece together a solution that worked for me, as I was getting error messages after following the advice of others.
Author: skunkbad
Community Auth for CodeIgniter 3.0
I resisted doing anything with CodeIgniter 3.0 for a long time, mostly due to the licensing that Ellislab had said they were going with. BCIT changed the license due to popular demand, and with an EOL notice for the 2.X branch posted about a month ago, I decided it was time to convert Community Auth over to CodeIgniter 3.0.
Text Editors Freezing on Search & Replace
I created a script that is run via cron that backs up the database of one of my websites, gzips it, and emails it to me. It works great, but I like to use a text editor to search and replace the domain name, so that I can use it in a development environment. As the backup file has been getting larger, I’ve reached the point where neither Sublime Text or gedit will do a “Replace All” without totally freezing. Linux makes this a non-issue:
#search for production.com and replace with dev.com sed -i 's/production.com/dev.com/g' ./production-dump.sql #overwrite dev database cat ./production-dump.sql | mysql -u username -ppassword database
Easy Backup & Restore a MySQL Database
If you want to make a database backup, it’s better to not use phpMyAdmin, because larger databases will cause that method of backup to fail. Instead, just use mysqldump, which should already be installed if mysql is installed:
#backup mysqldump -u username -ppassword database | gzip > ./dumpfilename.sql.gz #restore gunzip < ./dumpfilename.sql.gz | mysql -u username -ppassword database
MySQL: Convert Column From One Timezone to Another
It’s a pretty common thing to find an app that doesn’t specify to MySQL the timezone that should be used when storing dates and times. Once you’ve fixed that, you may still have a bunch of dates and times that need to be converted.
Website Forms Taken Offline
Today I finally had time to take my forms offline. I’m too busy to take on new customers, and trying to estimate a time when I can schedule a new project is unreasonable. I have mixed feelings about this, but what else can I do?
Accidently Removed Myself From Sudoers!
I’ve used Linux for years, primarily Ubuntu Desktop and Server. Recently I had been purchasing computer parts, anticipating the building of my next computer. Last Monday I put it all together, and started in on loading my operating system of choice, Ubuntu 14.04. Moving forward, I then started installing the essential programs that I use. I really didn’t run into any problems, until I made a stupid mistake while adding myself to a group.