SUSE 12 SP2 Install Mysql 5.7.16

SUSE 12 SP2 Install Mysql 5.7.16_第1张图片

 

下载mysql

wget -N -p /root/ http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.16-1.sles12.x86_64.rpm-bundle.tar

解压mysql

tar -xvf /root/mysql-5.7.16-1.sles12.x86_64.rpm-bundle.tar -C /root/

mysql 安装 

zypper ar -y /root/mysql-community-common-5.7.16-1.sles12.x86_64.rpm /root/mysql-community-libs-5.7.16-1.sles12.x86_64.rpm /root/mysql-community-client-5.7.16-1.sles12.x86_64.rpm /root/mysql-community-server-5.7.16-1.sles12.x86_64.rpm

启动mysql

systemctl start --now mysql

设置root密码

mysql -uroot -p`cat  /var/log/mysql/mysqld.log | grep 'password is generated' | awk '{print $NF}'` --connect-expired-password -e "alter user root@localhost identified by 'Report@123';"

赋予mysql远程登陆权限

mysql -uroot -pReport@123 -e "update user set Host='%' where User='root'; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Report@123'; flush privileges;"

你可能感兴趣的:(Suse,Mysql)