MySQL Server Installation And Configuration


Related Docs:   Moving MySQL Upgrading to MySQL 4

Below is the procedure of installing MySQL database software and adding MySQL server to H-Sphere cluster.


Step-By-Step Installation


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 -i mysql

If this gives you something like:


you already have MySQL DBMS installed. See the list of H-Sphere packages for the version of MySQL packages currently installed with H-Sphere.


Step 2. Download MySQL

If you don't have MySQL installed, download MySQL binary RPM distribution. On the Web site, 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 -ivh /path/to/downloaded/mysql-4.xx.xx-x.rpm
where mysql-4.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 the mysql user. To find out the path to the MySQL home directory, log in as the mysql user under root, and then type pwd:
# su - mysql
# pwd

Or, finger the mysql user for details:
# finger mysql

In .my.cnf, you must insert the following lines:


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.


Step 5. Adding MySQL Server To H-Sphere

After you have installed and configured MySQL software on a new box, add MySQL server to H-Sphere cluster. If MySQL is installed on a live H-Sphere box, add MySQL as a new H-Sphere service.


MySQL Log File

/var/log/mysqld is the MySQL server log file.


Backing Up MySQL Database

To back up MySQL database, back up the MySQL home directory, or use the mysqldump utility to dump the database. Type 'man mysql', 'man mysqldump' or see MySQL documentation for details.


H-Sphere MySQL Scripts

On MySQL database box in /hsphere/shared/scripts the following scripts must be installed:

mysql-change-user-password - changes user password - changes user password
mysql-db-size - calculates database size - calculates database size
mysql-drop-database - drops database - drops database
mysql-resume-user - resumes suspended user - resumes suspended user
mysql-create-db - creates database - creates database
mysql-db-users - lists MySQL database users who have any privilege on this database - lists MySQL database users who have any privilege on this database - gets superuser login and password - gets superuser login and password
mysql-revoke-all - revokes all user privileges on database - revokes all user privileges on database
mysql-create-user - creates MySQL user - creates MySQL user
mysql-delete-user - deletes MySQL user - deletes MySQL user
mysql-grant-priv - grants given privilege on given database to given user - grants given privilege on given database to given user
mysql-suspend-user - suspends MySQL user - 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: 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.



To upgrade phpMyAdmin:

  1. Login as root to the web server box where phpMyAdmin is configured. (In /hsphere/local/home/cpanel/shiva/psoft_config/ file, PHP_MY_ADMIN_HOST points to the identifier of the logical server where phpMyAdmin is configured. Usually, it is the first web server added to the system.)
  2. Go to the directory /hsphere/shared/apache/htdocs/phpMyAdmin and back up the file It has the required settings.
  3. Download the needed version of phpMyAdmin from
  4. Untar the file's content into the phpMyAdmindirectory in the apache DocumentRoot on the web 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.
  5. Open 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.

Related Docs:   Moving MySQL Upgrading to MySQL 4

Home   Products   Services   News
© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map