海外主机测评

您现在的位置是:首页 > 数据库 > 正文

数据库

yum在线安装

cds8202023-02-15数据库149
1、下载并安装MySQL官方的YumRepository[@node1~]#wget-chttps://dev.mysql.com/get/mysql80-community-releas

1、下载并安装MySQL官方的 Yum Repository

[@node1 ~]# wget -c https://dev.mysql.com/get/mysql80-community-release-el7-5.noarch.rpm

2、添加 MySQL Yum Repository

[ ~]# yum localinstall mysql80-community-release-el7-5.noarch.rpm -y

3、选择安装发行版

前提: 安装YUM 

[ ~]# yum-config-manager --disable mysql80-community   #禁用8.0
[ ~]# yum-config-manager --enable mysql57-community    #启用5.7

验证

[ ~]# yum repolist enabled | grep -i ^mysql
mysql-connectors-community/x86_64       MySQL Connectors Community           230
mysql-tools-community/x86_64            MySQL Tools Community                138
mysql57-community/x86_64                MySQL 5.7 Community Server           564

4、在线安装

[ ~]# yum install -y mysql-community-server

5、启动数据库

[ ~]# systemctl enable --now mysqld

6、登陆

[ ~]# tmp_pwd=`awk '/temporary password/ {print $NF}' /var/log/mysqld.log`
[ ~]# mysql -uroot -p$tmp_pwd
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connectiON id is 10
Server version: 5.7.37 MySQL Community Server (GPL)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~