下载地址http://mirrors.sohu.com/mysql/MySQL-5.7/

1、

    wget -c  http://mirrors.sohu.com/mysql/MySQL-5.7/MySQL-server-5.7.23-1.sles11.x86_64.rpm     

       wget -c  http://mirrors.sohu.com/mysql/MySQL-5.7/MySQL-client-5.7.23-1.sles11.x86_64.rpm

       wget -c  http://mirrors.sohu.com/mysql/MySQL-5.7/MySQL-lib-5.7.23-1.sles11.x86_64.rpm 

       wget -c  http://mirrors.sohu.com/mysql/MySQL-5.7/MySQL-common-5.7.23-1.sles11.x86_64.rpm   

 

2、安装

    rpm -ivh MySQL-5.7/MySQL-common-5.7.23-1.sles11.x86_64.rpm   

   rpm -ivh  MySQL-lib-5.7.23-1.sles11.x86_64.rpm 

   rpm -ivh  MySQL-client-5.7.23-1.sles11.x86_64.rpm

  rpm -ivh  MySQL-server-5.7.23-1.sles11.x86_64.rpm     

 

3、添加内容

  /etc/my.cnf

validate_password=off

 

4、启动mysql

  service mysql start 

 

5查找临时密码

cat  /var/log/mysql/mysqld.log

2019-02-25T03:25:01.967063Z 1 [Note] A temporary password is generated for root@localhost: j-?RokZA%9sU

 

6、登录mysql

  mysql -uroot -pj-?RokZA%9sU

 

7、修改密码

   SET PASSWORD = PASSWORD('123456');  

 

8、开发端口

1. 进入cd etc/sysconfig,编辑防火墙配置文件:

vi SuSEfirewall2

2 在文件后面加入如下配置:

FW_SERVICES_EXT_TCP="80 22 8080" ,保存退出

3. 执行 rcSuSEfirewall2 restart

说明:FW_SERVICES_EXT_TCP只能配置一次,写在后面的配置会覆盖前的配置;各个端口号之间用空格隔开(不是其他分隔符!!!)