This document explains the procedure of installing
MySQL database software from binary RPM distribution for LINUX
and some FreeBSD divergencies.
Step 1. Check for MySQL on your box
First, check whether MySQL database server is installed.
You can do this by entering the following command into your command
prompt:
which mysql
If it returns you a path, for example "/usr/bin/mysql",
you have MySQL database software installed. Alternatively, you can
try to find an installation of MySQL by running the following command
in your command prompt:
rpm -qa | grep MySQL
If this gives you something like:
MySQL-3.22.32-1
MySQL-client-3.22.32-1,
you already have MySQL database software. You can now use the existing version
or uninstall it and install a newer version.
Step 2. Download MySQL
If you don't have MySQL installed, download MySQL
binary RPM distribution. On the Web site www.mysql.com,
go to the Download section, select the latest stable release,
than select "The server for i386 systems" from
the "Standard binary RPMs" list. Also, you will
need client programs, so go back to the Download section
and download "client programs for i386 systems"
from the "Standard binary RPMs" list.
Step 3. Install MySQL
Now that you have downloaded MySQL database software
installation package, execute the following command:
rpm -i /path/to/downloaded/MySQL-3.xx.xx-x.rpm
where MySQL-3.xx.xx-x.rpm is MySQL binary RPM
distribution filename.
Step 4. Configure MySQL
To get MySQL working, you now need to configure the
software installed.
Connection from H-Sphere to MySQL database is performed
via SSH. In order to connect to MySQL database with a user name
and password, put the .my.cnf file in the home directory
of the user under which SSH connection is established. Typically,
it is MySQL user. To investigate his/her home directory, type the
following in your command prompt:
finger mysql
In this file you must insert the following lines:
[client]
user=login_of_some_highly_privileged_user
password=his_password
where login_of_some_highly_privileged_user
is the login name of MySQL database user which have insert, update,
delete, select, privileges on MySQL system database (those called
mysql). his_password is the plain text password of this
user.
WARNING: For security reasons you MUST set
access type for .my.cnf file to 0400 or 0600.
On MySQL database box in /hsphere/shared/scripts
the following scripts must be installed:
mysql-change-user-password Changes user password
mysql-change-user-password.sh Changes user password
mysql-db-size Calculates database size
mysql-db-size.pl Calculates database size
mysql-drop-database Drops database
mysql-drop-database.sh Drops database
mysql-resume-user Resums suspended user
mysql-resume-user.sh Resumes suspended user
mysql-create-db Creates database
mysql-create-db.sh Creates database
mysql-db-users Lists MySQL database users who have any
privilege on this database
mysql-db-users.sh Lists MySQL database users who have any
privilege on this database
mysql-get-login.pl Gets superuser login and password
mysql-get-login.pl.sh Gets superuser login and password
mysql-revoke-all Revokes all user privileges on database
mysql-revoke-all.sh Revokes all user privileges on database
mysql-create-user Creates MySQL user
mysql-create-user.sh Creates MySQL user
mysql-delete-user Deletes MySQL user
mysql-delete-user.sh Deletes MySQL user
mysql-grant-priv Grants given privilege on given database
to given user
mysql-grant-priv.sh Grants given privilege on given database
to given user
mysql-suspend-user Suspends MySQL user
mysql-suspend-user.sh Suspends MySQL user
All scripts accept some command line parameters. All
scripts consist of two parts. The first part typically without extension
sets some necessary variables and then calls the second part of
the script under sudo.
INFO: fix_perm.sh scripts sets needed
owner and rights to mysql scripts.
WARNING: Some of this scripts are different on FreeBSD systems,
so copy corresponding versions of scripts from /hsphere/shared/scripts/FreeBSD.
phpMyAdmin
To upgrade phpMyAdmin:
- Log into the CP server as root.
- Go to the directory /hsphere/shared/apache/htdocs/phpMyAdmin
and back up the file config.inc.php. It has the required settings.
- Download the needed version of phpMyAdmin from www.phpmyadmin.net.
- Untar the file's content into the phpMyAdmindirectory in the
apache DocumentRoot on the Control Panel server, e.g.
/hsphere/shared/apache/htdocs/phpMyAdmin. Before you continue
the installation, it would be a good idea to read the documentation
supplied with phpMyAdmin installation package including the Documentation.txt file.
- Open config.inc.php in the phpMyAdmin directory. This
file contains phpMyAdmin settings. Change $cfg['Servers'][$i]['host'],
$cfg['Servers'][$i]['user'] and $cfg['Servers'][$i]['password']
to the values you have in the file you have backed up. The username and password
are also available in the ~mysql/.my.cnf file.
|