MySql8
下载rpm:
wget https://dev.mysql.com/get/mysql80-community-release-el7-4.noarch.rpm
安装
rpm -ivh mysql80-community-release-el7-4.noarch.rpm
刷新yum
yum clean all | yum makecache
查看版本(可选)
yum repolist all | grep mysql
安装
yum -y install mysql-community-server
查看版本:
mysqld -version
mysqladmin -V
systemctl start mysqld
设置开机启动
systemctl enable mysqld
查看初始密码
grep 'temporary password' /var/log/mysqld.log
第一次登录
mysql -uroot -p密码
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';
创建远程登录用户
-- 创建一个可以远程登陆的root用户
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'CUSTOM-PASSWORD';
--- 为账户开放权限
grant all privileges on *.* to 'username'@'%';
flush privileges;