Month: March 2013

I rebooted an Ubuntu 12.04 server after upgrading the kernel and MySQL. However, I found that the new MySQL would you not start. When I tried:

sudo service start mysql

I got:

start: job failed to start

There were no errors appearing in the /var/log/mysql/error.log and so there was no information to help debug it. I found this post and tried every single one of the solutions. When I removed mysql-server-5.5 using:

apt-get –purge remove mysql-server
rm /etc/mysql/ -R

I found the when I reinstalled mysql-server the installation would fail saying:

Unable to set password for the MySQL “root” user An error occurred while setting the password for the MySQL administrative user. This may have happened because the account already has a password, or because of a communication problem with the MySQL server.

I then got stuck because I could no longer remove MySQL because it was only partially installed. Every time I tried to remove it, it would ask me to put in a new root password which I obviously could not do. The solution is to use dpkg to purge the partially installed package:

dpkg –purge mysql-server-5.5

Then I tried reinstalling again and got:

Can’t find file: ‘./mysql/host.frm’ (errno: 13)

Basically, the solution to these problems is a complete purge of MySQL and removing ALL of it and start again. I found what mysql related packages I have install by running:

I wanted to monitor our HP server raid array on Ubuntu 12.04. I am sure that there is a good way of setting this up with Nagios or SMNP – however, I thought I would write a little bash script which emails me if any of the hard drives in the raid array fail. I assume that you have already installed the HP Proliant Support Pack perhaps using these instructions.

To send an email from command line you will also need mailx. This is a virtual package on Ubuntu and I tend to install bsd-mailx. To install it run:

sudo apt-get install bsd-mailx

It will also install Postfix (if this isn’t already setup). When configuring Postfix, I selected “Internet Site” and entered the hostname of the server.

Here is the bash script that I wrote. The indentation seems to have got lost but you should be able to recreate it.