MySQL has the advantages of simple and easy to learn and small size, and is popular among beginners in programming development.
Tools/Materials
- CentOS computers connected to the Internet
Install MySQL
- 1
Installing MySQL under Centos 6.6 is simple,
Yum List Mysql-server
- 2
When there is only one time, you can directly
Yum Install Mysql-server
To install
- 3
Select Y in the process to continue the installation and finally install successfully
END
Setting up the MySQL service
- 1
Start the MySQL service first
Service mysqld Start
- 2
Connect it and try it directly
Mysql
And then
\q
Close connection
- 3
Set MySQL boot up
Chkconfig mysqld on
- 4
Open Port 3306 and save
/sbin/iptables-i input-p TCP--dport 3306-j ACCEPT
/etc/rc.d/init.d/iptables Save
END
Modify password and set remote access
- 1
Connect to MySQL Database
Set Password
Use MySQL;
Update user set Password=password (' Password ') where user= ' root ';
Flush privileges;
- 2
Setting up MySQL remote access
Grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT option;
END
Solve MySQL garbled problem
Find a configuration file, copy it to the/etc/directory, and name it MY.CNF
(sometimes without my.cnf)
Cp/usr/share/doc/mysql-server-5.1.73/my-medium.cnf/etc/my.cnf
- 2
Vim MY.CNF
Add both under [client] and [mysqld]
Default-character-set=utf8
- 3
Finally press ESC to enter
: Wq
Save exit
END
Restart MySQL Service
- 1
And then you restart the service.
Service mysqld Restart
CentOS MSYQL Installation and configuration