1. Install MySQL
#yum-y Install Mysql-server
2. Set self-start and start MySQL
Set up MySQL service to boot from system startup
#chkconfig mysqld on
Confirm MySQL self-boot (ok if 2--5 is on)
#chkconfig--list mysqld
Start the MySQL service
#/etc/rc.d/init.d/mysqld start
3. Set password (default root user does not set password)
Log in to MySQL
#mysql-U Root
Switch Database (MySQL)
>use MySQL
View user Information
>select User,host,password from user;
Set Password
>set password for [email protected]=password (' root ');
Quit MySQL
>exit
Login with username and password
#mysql-U root-p
Then output the password to enter
Settings allow the extranet IP to access MySQL
>update user set host= '% ' where user= ' root ';
>flush privileges;
Authorizing the root user to connect to the MySQL server from any host using a password
>grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;
>flush privileges;
Installation and configuration of the CentOS cloud server MySQL