List

Earlier this week I was running an apt upgrade and noticed MySQL was going to update. I didn’t think twice and continued with the upgrade anyway, but I had near instant regret. After the update completed, I used the ‘mysql_upgrade’ command, as you always do after a MySQL update, and got back weird errors about how my tables were corrupted. Panicking, I tried to restart MySQL, which failed to start back up. Thankfully, I had a full backup from a few hours earlier and was back up in a few minutes. I have heard about pinning packages to a specific version, especially for databases, and I decided now would be a good time to set that up.

First, let’s see what MySQL packages we have installed. I use Percona MySQL, so I am filtering for packages containing Percona in the name.

dpkg -l | grep percona

Looking at this list, I want to hold back these packages. To do that, let’s use apt-mark’s hold command.

sudo apt-mark hold percona-server-server-5.7 percona-server-tokudb-5.7 percona-server-common-5.7 percona-server-client-5.7

Now when I run apt upgrade, these packages will be held back. This is a good idea for databases, and programs that need to run on older programming languages, but keep in mind if a package is held back it will not receive security updates or new features.

To allow a package to upgrade again, just use apt-mark unhold.

sudo apt-mark unhold percona-server-server-5.7 percona-server-tokudb-5.7 percona-server-common-5.7 percona-server-client-5.7

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Posts

1 2 3 4
February 28th, 2018

Concluding the February Challenge

Writing every day for the month of February has been an experience, and has changed my perspective on writing tremendously. […]

February 27th, 2018

Cloudflare2DB

Cloudflare stats are very useful, but they expire and can’t be tracked over a long period of time. That’s why […]

February 26th, 2018

Nightly Database Backups to Google Drive

If you have a Google Apps account (a business account with more than 5 users or one provided by your […]

February 25th, 2018

Sublime Text

Sublime Text is a really powerful text editor and includes tons of functionality relevant to programming. I will dive into […]

February 24th, 2018

Great Resources for Student Developers

Being enrolled in a university comes with its pros and cons (a topic itself worthy of many other blog posts), […]

February 23rd, 2018

What is MVC?

MVC is a term thrown around lots of software development projects. Laravel, Zend, CodeIgniter, Ruby on Rails, Django, iOS, and […]

February 22nd, 2018

Getting Started With Phalcon PHP

To get started with Phalcon, I already have my server stack setup with Ubuntu 16.04, Percona MySQL, Nginx, and PHP […]

February 21st, 2018

What is Phalcon?

Phalcon is a modern PHP framework with the typical feature set you’d expect. Database ORM, error handling, MVC architecture, and […]

February 20th, 2018

Setting Up a PHP Development Environment

If you do PHP development, moving to a PHP IDE is extremely beneficial especially when debugging. PHPStorm is a great […]