码迷,mamicode.com
首页 > 数据库 > 详细

yum安装8.0mysql数据库

时间:2021-06-04 19:54:22      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:mysql数据库   查看   gre   stat   put   get   use   clear   serve   

yum安装依赖包

yum -y install libaio

下载mysql_8.x版本rpm包

wget http://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm

安装mysql_yum源

yum localinstall mysql80-community-release-el7-1.noarch.rpm

查看yum包是否存在

yum repolist enabled |grep "mysql.*-community.*"

mysql-connectors-community/x86_64 MySQL Connectors Community 203

mysql-tools-community/x86_64 MySQL Tools Community 129

mysql80-community/x86_64 MySQL 8.0 Community Server 265

yum安装mysql

yum install mysql-community-server -y

systemctl start mysqld

systemctl status mysql

查看mysql初始密码

grep password /var/log/mysqld.log

登录mysql

mysql -uroot -p
Enter password:
Server version: 8.0.25-----(MySQL版本)
......
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql>

修改初始密码

mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘你的密码‘;

修改权限可以远程登录mysql

mysql> select host,user,authentication_string,plugin from user;
mysql> update user set host=‘%‘ where user=‘root‘;
mysql> flush privileges;

yum安装8.0mysql数据库

标签:mysql数据库   查看   gre   stat   put   get   use   clear   serve   

原文地址:https://www.cnblogs.com/cfy930721/p/14850471.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!