Installing MySQL 5.1 (Ubuntu 9.10)

I bought the “Build your own Database driven web site” book and followed the steps to install PHP, Apache and MySQL on my Ubuntu machine. PHP and Apache looks okay but I am receiving an error message when I am trying to execute the following command.
(I did the previous steps without any error message)

root@machine:/usr/local/mysql# bin/mysqladmin -u root status
bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: NO)’

Here are the previous steps:
root@machine:/usr/local/mysql# groupadd mysql
root@machine:/usr/local/mysql# useradd -g mysql mysql
root@machine:/usr/local/mysql# chown -R mysql .
root@machine:/usr/local/mysql# chgrp -R mysql .
root@machine:/usr/local/mysql# scripts/mysql_install_db --user=mysql
root@machine:/usr/local/mysql# bin/mysqld_safe --user=mysql &

Any help would be appreciated…

Any particular reason you didn’t just use ‘sudo tasksel’ and pick ‘LAMP Installation’ (exact wording varies a bit between distros/versions). It sets up everything for you and prompts you to select a root password for mysql… way easier than screwing around trying to install the individual components and works just fine for 99% of usage.

I can’t really help you with the other steps, as I’ve never done it that way :wink:

Thank you memilanuk. I did not know anything about sudo tasksel. I did format my computer and installed everything again with tasksel and it works perfect. Thank you very much for this information.