Installation and configuration of MySQL database under Linux

Cloud computing infrastructure platform construction and application based on centos6.5

(3) Installation and configuration of MySQL database under Linux

The training involves the node
controller compute
training target

  1. Complete the installation of the MySQL database package;
  2. Complete the modification of the MySQL database configuration file;
  3. Complete the MySQL database startup and various configurations;
  4. Complete the package installation of MySQL database on the compute node
    1. Installation of basic MySQL components (controller)
[root@controller ~] # yum -y install mysql mysql-server MySQL-python

2. Modify the configuration file of the MySQL database

[root@controller ~] # vi /etc/my.cnf

Add the following 5 lines of configuration file in [mysqld].

bind-address = 192.168.100.10
default-storage-engine = innodb
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

Save and exit

The function of bind-address is to access the database through the bound IP address; the function of
default-storage-engine is to set the default storage engine of the database;
the function of collation-server is to set the rules of which encoding method is used by the database to describe characters and not It is case sensitive;
the function of init-connect is to set the storage encoding method of the database; the function of
character-set-server is to set the character encoding method of the client;

3. Start the MySQL database

[root@controller ~] # service mysqld restart

Set boot up

[root@controller ~] # chkconfig mysqld on

4. Configure the
database 4.1 Initialize the database

[root@controller ~] # mysql_install_db

4.2 Security configuration of the database

[root@controller ~] # mysql_secure_installation

Press enter to confirm and set the database root password

Remove anonymous users? [Y/n] y Do you want to delete anonymous users
Disallow root login remotely? [Y/n] n Do you not allow root users to log in remotely
Remove test database and access to it? [Y/n] y Do you want to delete " test" database
Reload privilege tables now? [Y/n] y Whether to reload privilege tables now?

5. Install the python package of MySQL database (compute)

[root@controller ~] # yum -y install MySQL-python

Appropriate installation method for installing MySQL database on Linux system

Guess you like

Origin blog.csdn.net/qq_44750380/article/details/103866802