Note: To install MySQL using yum in CentOS Linux, you must install MySQL in a network environment. For more information about how to connect to the network in Linux, see the previous article!
Article 1: install and configure MySQL
Step 1: Install MySQL
[Root @ 192 local] # yum-y install mysql-server Plugin install MySQL
[Root @ 192 local] # yum-y install php-mysql plugin install php-mysql
Step 2: Configure MySQL
[Root @ 192 local] # vim/etc/my. cnf plugin edit the MySQL configuration file
[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1 encode find this line, add a new rule below this line, let MySQL's default code as UTF-8
Default-character-set = utf8 character add this line
Add the following statement at the end of the configuration file:
[Mysql]
Default-character-set = utf8