Install and Configure the Database
53
# yum install mysql-server
# chkconfig --level 35 mysqld on
3. Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) and
insert the following lines in the [mysqld] section. You can put these lines below the datadir line.
The max_connections parameter should be set to 350 multiplied by the number of Management
Servers you are deploying. This example assumes two Management Servers.
innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=700
log-bin=mysql-bin
binlog-format = 'ROW'
Note
The binlog-format variable is supported in MySQL versions 5.1 and greater. It is not
supported in MySQL 5.0. In some versions of MySQL, an underscore character is used in
place of the hyphen in the variable name. For the exact syntax and spelling of each variable,
consult the documentation for your version of MySQL.
4. Start the MySQL service, then invoke MySQL as the root user.
# service mysqld start
# mysql -u root
5. MySQL does not set a root password by default. It is very strongly recommended that you set
a root password as a security precaution. Run the following command, and substitute your own
desired root password for <password>. You can answer "Y" to all questions except "Disallow root
login remotely?". Remote root login is required to set up the databases.
mysql> SET PASSWORD = PASSWORD('password');
From now on, start MySQL with mysql -p so it will prompt you for the password.
6. To grant access privileges to remote users, perform the following steps.
a. Run the following command from the mysql prompt, then exit MySQL:
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ WITH GRANT OPTION;
mysql> exit
b. Restart the MySQL service.
# service mysqld restart
c. Open the MySQL server port (3306) in the firewall to allow remote clients to connect.
# iptables -I INPUT -p tcp --dport 3306 -j ACCEPT