[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Installing MySQL 3.23.36- HOW TO



For the couple of people that have asked me, here are the steps to install the latest MySQL on your RaQ machine.

Please note: * these instructions were performed on a Cobalt RaQ3 and are not guaranteed to work on other Cobalt machines *

The installation is pretty straight forward if you just take your time, and make sure you read the output at each stage.

1. Uninstall previous MySQL version.

It seems a lot of RaQ machines have the RPM installed that was provided on the Cobalt FTP site. This needs to be removed before you can proceed. Login in to your machine via SSH or Telnet as the admin user, and use;

rpm -qa | grep MySQL

which will search for installed MySQL RPM's.  Next;

rpm -e <packagename>

to remove the MySQL package- do this for all MySQL related packages including client, server and developer.

2. Get the MySQL tarball.

to get to admin's home directory;

cd

to grab the tarball use;

wget http://www.mysql.com/Downloads/MySQL-3.23/mysql-3.23.36.tar.gz

This will get the tarball and put it in your home directory. If you do not have wget installed, then you will have to grab the tarball using your browser and FTP the file to your server.

3. Unpack the tarball.

to unpack the archive use;

gunzip mysql-3.23.36.tar.gz

and then;

tar xf mysql-3.23.36.tar

4. Enter the source directory.

cd mysql-3.23.36

5. Configure your build.

MySQL can be built with several user-defined options, but we are going to keep things simple and just specify the directory in which MySQL and it's related files will be installed;

./configure --prefix=/usr/local/mysql

6. Compile the source.

make

This stage takes some time, so be patient and be sure to check all messages returned from the compiler. If any errors or warnings and returned, then *stop* and check the manual for more information.

7. Check the build.

If everything compiled okay, check the build with;

make check

Again, make sure there are no errors returned.

8. Change to the root user.

To install the package, you must be the root user so;

su

9. Install files.

make install

then;

scripts/mysql_install_db

10. Breath a sigh of relief!

That's the tricky bits over with, now you just have to set up the MySQL server to run in the background everytime the server boots.

11. Set up MySQL root password.

You must set a password for the MySQL root user ( this is different to the normal system root user );

cd /usr/local/mysql
bin/mysqladmin -u root -p password <new-password>
bin/mysqladmin -u root -h <server-name> -p password <new-password>

12. Set up a MySQL user and group.

For security reasons, we are no going to set up a special user that can do nothing but run the MySQL server;

/usr/sbin/groupadd mysqlgrp
/usr/sbin/useradd -g mysqlgrp mysqlusr

13. Set permissions in MySQL directory.

To secure the MySQL database directory, we must change some permissions;

chown -R mysqlusr.mysqlgrp var
chown -R go-rwx var

14. Test the MySQL server.

Okay, now we are going to launch the server for the first time;

bin/safe_mysqld --user=mysqlusr &
bin/mysqladmin -user root -p<password> status

This will run the server in the background and show some information about the server.

15. Install the mysql.server script.

To get the MySQL server to run everytime the server boots, we must install a special startup-script;

cp share/mysql/mysql.server /etc/rc.d/init.d/
cd /etc/rc.d/init.d
chmod 500 mysql.server
cd /etc/rc.d/rc3.d
ln -s ../init.d/mysql.server s99mysql
cd /etc/rc.d/rc5.d
ln -s ../init.d/mysql.server s99mysql

16. Clean up.

Return to the admin account and delete the source directory and tarball;

exit
cd
rm -r mysql-3.23.36
rm mysql-3.23.36.tar

And that should be it. Hopefully you now have a fully functional MySQL setup. If you have any problems, *please* look at the documentation at http://www.mysql.com/manual before posting on this or any other list.

If anybody has any comments or queries about MySQL installation then feel free to email me and I will try my best to help you out.

Regards,

-Glen