Debian Lenny - Installing MySQL

Installing MySQL on Debian Lenny is very simple using the 'aptitude' package manager.

This article will go through the install process and you will have a database server up and running in no time.

MySQL install

To begin with, a simple MySQL install:

sudo aptitude install mysql-server mysql-client libmysqlclient15-dev

Note that we have installed the development libs and headers with the 'libmysqlclient15-dev' package - you can leave that out but I have found that they are useful in many siutations.

MySQL Password

During the installation of MySQL, you will be presented with the option to install a password:

MySQL password request

Setting the MySQL Root password is a recommended step in setting up your Slice. However, it is, of course, up to you.

Should you decide that protecting your production database is a good idea, then simply enter your chosen password as directed.

Unlike previous Debian releases, Lenny asks for a confirmation of the password (which is a good thing!):

MySQL password confirmation


If you are not going to use InnoDB with your MySQL databases, then it is a good idea to turn it off right at the start. It uses a lot of memory and, if not going to be used, this is wasted memory.

Open the main MySQL config file:

sudo nano /etc/mysql/my.cnf

Search my.cnf for the heading:

# * InnoDB

Then, to turn off InnoDB, simply uncomment (remove the #) on this line:


Done. It really is as simple as that.

Ben B.

Article Comments:

annon commented Fri Apr 24 12:29:43 UTC 2009:

"Unlike previous Ubuntu releases, Hardy asks for a confirmation of the password (which is a good thing!):"

ubuntu or debian? :-)

Ben B commented Wed Apr 29 00:39:15 UTC 2009:

Thanks for pointing that out annon! Fixed!

Lex Sheehan commented Tue May 12 15:00:19 UTC 2009:

You may want to mention that InnoDB provides transactional support.

kinjal dixit commented Thu Sep 17 10:25:38 UTC 2009:

innodb is also required if you need referential integrity enforced.

sid commented Mon Mar 15 02:24:27 UTC 2010:

the article is simple and good .....

replace siutation with "situation" in your article :)

Carlos E Molina commented Thu Apr 22 02:57:04 UTC 2010:

I want to thank this site for the very good information about how to install MySQL on Debian, I spent hours yesterday trying to figure it out. Thank you very much!!!!!!!

Rubem commented Sat Oct 02 02:05:26 UTC 2010:

It was so nice. Congratulations. Bw. Rubien.

gaurav commented Fri Oct 22 09:24:18 UTC 2010:

nice work...........................thanks a lotttttttttttttttttttttttt

AwanShagrath commented Mon Oct 10 03:43:38 UTC 2011:

Nice shared.... I Like it,..,

Thanks master

Want to comment?

(not made public)


(use plain text or Markdown syntax)