当前位置:Gxlcms > 数据库问题 > yum安装8.0mysql数据库

yum安装8.0mysql数据库

时间:2021-07-01 10:21:17 帮助过:22人阅读

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   

人气教程排行