To mount your old hard drive in your new computer:
Open the old computer and take out the hard drive.
Open your new computer and connect the hard drive to the drive data ribbon.
If you are uncomfortable with that, you can buy a "rack" which plugs into a USB port on the new computer and which allows you to insert the naked internal drive into the rack. I think there are also things called USB enclosures which do the same thing. Sorry though -- I don't know that much about the hardware end of things.
Boot up the new computer and Ubuntu should hopefully recognize the new drive (most of the time there is no problem).
A second drive will be given a device name like /dev/sdb.
The first partition would be called /dev/sdb1. To mount the first partition:
To recover your database:
sudo mkdir /media/sdb1
sudo mount /dev/sdb1 /media/sdb1
First install mysql on the new machine.
If your old database was called 'mydata', then you might want to create an empty database on your new machine also called 'mydata'. This will create the appropriate folder. I'm not sure this is really necessary however.
sudo apt-get install mysql-server-5.0
Your old computer's first partition would then be mounted at /media/sdb1.
The mysql database (if it is on the first partition) would be located at /media/sdb1/var/lib/mysql.
First stop the mysql server:
Now simply the copy the files from
sudo /etc/init.d/mysql stop
Check that the files are owned by mysql, part of the mysql group, and have owner and group read/write permissions.
Then restart the mysql server:
You should then be able to access your database again.
sudo /etc/init.d/mysql start