CentOS7 install mysql

1. Uninstall the default installation of mariadb:

yum search mysql

yum remove mariadb.x86_64

2. Go to the official website to find the download version of mysql

https://dev.mysql.com/downloads/repo/yum/

Find the following Linux7, CentOS7 (CentOS is owned by Red Hat)

Right-click on the link below to copy the link directly (or you can download it locally and then use ftp to upload it to the server)

3. installation

Installation: wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

Note: It is recommended to proceed in the /tmp directory

4. Install yum source locally

yum localinstall mysql

5. Check if it has been installed

yum search mysql

Find the corresponding software package, copy the name

6. Install with yum

yum install mysql-community-server.x86_64

7. Check if the installation is successful

ps -ef | grep mysql

8. Start mysql

service mysqld start

service mysqld restart

service mysqld stop

9. Find the default login password

cat /var/log/mysqld.log | grep password

10. log in

mysql -uroot -p password

Note: It is recommended to use mysql -uroot-p and press Enter before entering the password. Because using the history command will see your password in plain text

11. change Password

SET PASSWORD =PASSWORD(' xxxx ');

12. Open remote connection permission

use mysql;

show tables;
select *from user \G

select host, user from user \G

Note: \G will format the display

update user set host="%" where Host='localhost' and user ="root";

Update permissions

flush privileges;

Or restart the service directly: service mysqld restart

Recommended Posts

CentOS7.2 install Mysql5.7.13
CentOS install mysql
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
CentOS 7.2 Yum install MySQL 5.6
Centos7 install Mysql8 tutorial
Install mysql under Centos 7
Centos7 install Mysql database
Install mysql5.1 under CentOS6.5
1.5 Install Centos7
Install mysql online on centos
centos install mysql through yum
Install MySQL 8.0.16 on Linux Centos
Install MySQL under Linux (CentOS 7)
Centos6 install mysql 5.7.x series
CentOS8 install MySQL8 (pro test)
Centos6 install Python2.7.13
How to install MySQL on CentOS 8
CentOS7 yum install and start mysql
CentOS install Redmine
Centos7 install Python 3.6.
CentOS 7 install Docker
CentOS 7 install Nginx, PHP, MySQL packages
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
Install MySql with Docker in CentOS7
Centos7 install Python2.7
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
Install MySQL on Linux CentOS7 (Windows)
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS7 yum install and start mysql
CentOS6 install mist.io
Centos7 install Docker
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
centOs install rabbitMQ
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
centos7 .*tar package to install MySQL5.7