Parallels H-Sphere Documentation System Administrator Guide

 

MySQL Server Installation And Configuration

 
 

Related Docs:   Moving MySQL Upgrading to MySQL 4

Last modified: 27 Dec 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

 

Step-By-Step Installation

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

 

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:

mysql-4.0.16-0
mysql-client-4.0.16-0

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 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 -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:

[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.

 

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
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 - resumes 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.

 

Remote Access to MySQL Logical Server

(H-Sphere 2.4.3 Patch 7 and up)

By default, MySQL client connects to MySQL server on localhost (127.0.0.1). Starting with H-Sphere 2.4.3 Patch 7, it becomes possible to configure MySQL client to use the -h option to connect to MySQL server remotely by logical server IP:

mysql -h <mysql_logical_server_ip>

This feature is, in particular, required in some custom MySQL configurations where one MySQL client (bound to physical server IP) connects to several MySQL servers on different boxes (bound to logical server IPs).

It is possible to enable or disable remote access to particular MySQL logical servers in Control Panel:

  1. go to the admin Control Panel, E.Manager menu, L.Server,
  2. choose a MySQL logical server from the list of logical servers,
  3. under Additional Options, check or uncheck the option Remote Access To MySQL Server and press Set:

    Confirm your choice on the page that appears.

WARNING:
1) Remote access to MySQL server is currently incompatible with H-Sphere mail system! You must not enable remote MySQL access on physical servers with live mail!
2) You must not change logical server IP on or add another server IP to MySQL logical server where remote access is enabled to!

 

phpMyAdmin

Please refer to the separate PhpMyAdmin document.


Related Docs:   Moving MySQL Upgrading to MySQL 4



© Copyright 2017. Parallels Holdings. All rights reserved.