centos 安装mysql
centos 安装mysql
-
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
-
yum localinstall mysql57-community-release-el7-8.noarch.rpm
-
yum repolist enabled | grep "mysql*"
-
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
-
yum install mysql-community-server
-
systemctl start mysqld
-
grep 'temporary password' /var/log/mysqld.log
查询初始密码
-
mysql -u root -p
密码登录
-
set password for 'root'@'localhost'=password('123456Aa?');
设置root用户远程登录:
- use mysql;
- update user set host='%' where user='root';
- select host,user from user;
- flush privileges;
done!