Uninstalling MARIADB
CentOS has MARIADB installed by default, so you need to uninstall the MARIADB installed in your system before you install MySQL.
Install MySQL source
In CentOS, use the CD command to enter the path where you want to save the file, and use the wget command to download the RPM package. Example: wget -c https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
Install the MySQL source. Command: rpm -ivh "下载下来的MySQL源包名" . For example: rpm -ivh mysql57-community-release-el7-11.noarch.rpm
Install MySQL
Use commands to yum list | grep mysql view MySQL packages that can be installed in the warehouse
Install MySQL:yum install mysql-server
To set the root account password for MySQL, refer to: MySQL decompression version installation configuration
Run MySQL:mysql -u root -p
View MySQL configuration file under Linux
Execute in turn:
- which MySQL
- /usr/bin/mysql
- /usr/bin/mysql--verbose--help | Grep-a 1 ' Default options '
And then there will be some information like mine.
from inch The given order:
The meaning of this message is:
The server first read the/etc/mysql/my.cnf file, if the previous file does not exist then continue to read the/etc/my.cnf file, if it does not exist will read the ~/.my.cnf file
Reference Blog: 53895982
Modify the MySQL configuration file
75532382
MySQL Exit command
MySQL exits three methods:
MySQL > exit;
MySQL > quit;
MySQL > \q;
Reference Blog: 78057718
Online installation of MySQL in CENTOS7 environment