Configuring MySQL server
The MySQL server, mysqld, has many command options and system variables that can be set at startup to configure its operation. The configurations are stored in the my.cnf file.
- SSH into the database server host as a root user.
-
Open the
my.cnffile for editing in an editor such as vi or nano:On RHEL/CentOS/SLES:vi /etc/my.cnfOn Debian/Ubuntu:vi /etc/mysql/my.cnf -
Ensure that the
bind-addressproperty is set to0.0.0.0or is commented out if case of a default value.bind-address=0.0.0.0 -
Ensure that the
default-storage-engineproperty is set toinnodb, which is the default storage engine in MySQL versions 5.5 and higher.default-storage-engine=innodb -
Ensure that the
sql_modeproperty is set toSTRICT_ALL_TABLESto avoid columns being truncated during migration.sql_mode=STRICT_ALL_TABLES - Save the file and exit.
- Restart the database server.
-
Enable the server to automatically start on boot:
On RHEL/CentOS:
sudo chkconfig mysqld onOn SLES:sudo chkconfig mysql on sudo rcmysql statusOn Ubuntu, MySQL starts automatically after installation. Run the following command to check the status:sudo service mysql statusOn Debian, MySQL starts automatically after installation. Run the following command to check the status:sudo service mysql status
