依赖
zypper in -y gcc gcc-c++ libopenssl1_0_0 libtspi1 openssl-1_0_0 openssl-ibmpkcs11 openssl_tpm_engine trousers rollback-helper zypper-migration-plugin zypper-search-packages-plugin openssl opensll-devel glibc-32bit libgcc_s1-32bit libncurses5 libncurses5-32bit libncurses6-32bit libstdc++6-32bit numactl wget ntp vim
下载
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.12-1.sles12.x86_64.rpm-bundle.tar
rpm -qa | grep mysql
解压mysql
tar -xvf mysql-8.0.12-1.sles12.x86_64.rpm-bundle.tar
安装mysql
rpm -ivh mysql-community-common-8.0.12-1.sles12.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.12-1.sles12.x86_64.rpm
rpm -ivh mysql-community-client-8.0.12-1.sles12.x86_64.rpm
rpm -ivh mmysql-community-server-8.0.12-1.sles12.x86_64.rpm
启动mysql
systemctl start mysql
开机启动mysql
systemctl enable mysql
生成随机密码
grep 'temporary password' /var/log/mysql/mysqld.log
初始化默认密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Report@123';
FLUSH PRIVILEGES;
允许root用户在任何地方进行远程登录,并具有所有库任何操作权限
update user set Host='%' where User='root';
select user, host, plugin, authentication_string from user;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'Report@123';
flush privileges;