MySQL is a free, open-source relational database.
Although MySQL was acquired by Oracle Corporation. But Oracle does not limit the development of MySQL.
MySQL is currently the most widely used relational database, and many large companies are using it. As of this publication, MySQL has been updated to version 5.7.
MySQL Installation:
1. Download the MySQL repo source
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2. Install the RPN package
sudo rpm-ivh mysql-community-release-el7-5.noarch.rpm
3. Install MySQL
sudo yum install mysql-server-y
4. Start MySQL
Start MySQL
Service MySQL Start
Initial startup may cause an error, possibly due to insufficient permissions.
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
Enter the following command to
sudo chown-r root:root/var/lib/mysql Change the owner of MySQL to the root user
5. Change the password
There is no password after installation, so log in directly to the root account
Mysql-u Root
mysql > Use MySQL;
MySQL > Update user set Password=password (' 123456 ') where user= ' root ';
MySQL > exit;
6. Change MySQL's default encoding to UTF8
The MySQL configuration file installed via Yum is saved in/etc/my.cnf
Vim/etc/my.cnf
Add the client and add the default encoding settings under MYSQLD
[Client]
Default-character-set = UTF8
[Mysqld]
Character_set_server = UTF8
Save ESC Input after writing: Wq carriage return
Be sure to restart the MySQL service after modifying the configuration file
Service MySQL Restart
Log in to MySQL input
Show variables like ' character% ';
As shown, this completes the installation of MySQL, modifies the password, and modifies the default encoding to UTF8. All configuration information for MySQL can be modified under/ETC/MY.CNF.
Building of Lamp Environment (ii)----MySQL installation and configuration