HP OSMS Blueprint: Database Server on HP ProLiant Servers with MySQL and SLES10
NOTE: Storage Area Networks (SANs) provide flexibility in system management,
configuration, connectivity, and performance to meet the needs of changing business
environments. The HP StorageWorks SAN architecture provides open network storage
solutions for all sizes and types of businesses, including small to large IT departments and
enterprise environments. For more information about SAN solutions from HP, see the HP
SAN Infrastructure website at:
http://h18006.www1.hp.com/storage/saninfrastructure
4. For this example, change the default MySQL data directory to a file system located on an
HP SAN by following these steps:
a. Mount the file system, which resides on the SAN, to the /home/mysql directory.
b. Shut down the MySQL server by entering the following command:
# /etc/init.d/mysql stop
c. Move the entire data directory and all its contents to the new data directory by entering
the following command:
# mv /var/lib/mysql /home/mysql/
d. Because the data directory was changed, you must update the /etc/my.cnf file to
add the new data directory. To do this, under the [mysqld] section, change the
socket= line to refer to the new data directory location, and add the datadir= line
to refer to the correct path. Under the [client] section, change the socket= line to
refer to the new data directory location. The sections should look similar to the following:
[client]
#password = your_password
port = 3306
#socket = /var/lib/mysql/mysql.sock
socket = /home/mysql/mysql.sock
[mysqld]
datadir = /home/mysql
port = 3306
#socket = /var/lib/mysql/mysql.sock
socket = /home/mysql/mysql.sock
e. Start the MySQL server by entering the following command:
# /etc/init.d/mysql start
f. Verify the changes by entering the following commands:
# mysqlshow –u root –p
# mysqladmin –u root –p version
Managing the MySQL Database
Starting and Stopping the MySQL Database
To start the MySQL database and verify the daemon is started, enter the following commands
as the MySQL root user:
# /etc/init.d/mysql start
# ps –ef | grep mysqld
To stop the MySQL database and verify the MySQL daemon has disappeared, enter the following
commands as the MySQL root user:
10