您的位置:

CentOS7下安装MySQL8详细教程

一、CentOS安装MySQL

1、首先需要安装MySQL官方的yum repository, 打开终端,输入以下命令:

sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

2、安装MySQL服务:

sudo yum install mysql-community-server

3、启动MySQL服务:

sudo systemctl start mysqld.service

4、设置开机启动:

sudo systemctl enable mysqld.service

二、CentOS下安装MySQL

1、查看MySQL安装包:

sudo yum list installed | grep mysql

2、卸载MySQL:

sudo yum remove mysql* mariadb*

3、删除MySQL残留数据:

sudo rm -rf /var/lib/mysql*

4、重新安装MySQL:

sudo yum install https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
sudo yum install mysql-community-server

三、CentOS安装MySQL包

1、查看可以安装的MySQL包:

yum search mysql | more

2、选择安装包进行安装:

yum install mysql-server
或者:
yum install mysql5-server

四、CentOS7安装Docker

1、更新Yum软件包:

sudo yum update

2、安装需要的软件包:

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

3、配置官方Docker yum仓库:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

4、安装Docker CE:

sudo yum install docker-ce docker-ce-cli containerd.io

5、启动Docker并查看版本号:

sudo systemctl start docker
sudo docker version

五、CentOS7安装浏览器

1、安装Firefox浏览器:

sudo yum install firefox

2、安装Chrome浏览器:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum install google-chrome-stable_current_x86_64.rpm

六、CentOS7安装PHP7

1、安装PHP7及相关扩展:

sudo yum install epel-release yum-utils
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php74
sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysqlnd

2、启动PHP-FPM服务:

sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service

七、CentOS7安装SSH服务

1、安装SSH服务:

sudo yum install openssh-server

2、启动SSH服务:

sudo systemctl start sshd.service
sudo systemctl enable sshd.service

八、CentOS7.6安装SSH

1、升级OpenSSH:

sudo yum update openssh

2、配置并启用selinux:

sudo semanage port -a -t ssh_port_t -p tcp 22
sudo systemctl restart sshd
sudo setsebool -P ssh_keysign on

九、CentOS安装Nginx

1、添加EPEL仓库:

sudo yum install epel-release

2、添加Nginx仓库:

sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx

3、检查Nginx是否成功安装:

nginx -v

十、CentOS安装删除老分区

1、查看分区信息:

sudo fdisk -l

2、卸载老的分区:

sudo umount /dev/sdc1

3、删除老的分区:

sudo fdisk /dev/sdc
d
w

以上就是CentOS7下安装MySQL8的详细教程,按照以上步骤,您可以顺利地完成MySQL的安装和配置。如果遇到问题,请尝试重新执行或者在相关官方文档进行查找。