Suse Linux 安装Mysql 5.7.15

suse环境下最好用rpm包来安装,因为大多数suse Linux本身是没有安装gcc的,我尝试过安装gcc,暂时还没有安装成功过,后面成功了再补文档
1.下载MySQL的rpm-bundle包

链接: https://pan.baidu.com/s/15BBMJrfHXsK7YRWVR0BNUw 提取码: 2bce

2.解压

tar xvf mysql-5.7.15-1.sles11.x86_64.rpm-bundle.tar

2.安装Mysql安装顺序安装

rpm -ivh mysql-community-common-5.7.15-1.sles11.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.15-1.sles11.x86_64.rpm
rpm -ivh mysql-community-client-5.7.15-1.sles11.x86_64.rpm
rpm -ivh mysql-community-server-5.7.15-1.sles11.x86_64.rpm

3.启动Mysql服务

service mysql start

4.查看MySQL服务器的状态

service mysql status

5.设置开机启动

chkconfig mysql on

6.生成随机密码

grep 'temporary password' /var/log/mysql/mysqld.log

7.初始化默认密码

mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Report@123';

8.允许root用户在任何地方进行远程登录,并具有所有库任何操作权限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Report@123' WITH GRANT OPTION;
FLUSH PRIVILEGES;

你可能感兴趣的:(数据库)