mySql Linux 下安装 mysql 5.7二进制文件

实践环境:

centos 6.9
mysql mysql-5.7.20-linux-glibc2.12-x86_64

参考资料:https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html

按需要安装所需要软件
yum 安装

mysql>yum search libaio # search for info  
mysql>yum install libaio # install library

apt 安装

mysql>apt-cache search libaio # search for info  
mysql>apt-get install libaio1 # install library 

1、解压到你需要的安装目录一般在 /use/local/mysql,不是这个目录时需要自行处理链接快捷 socket,参考:https://juejin.im/post/5d37fffce51d4556bb4cd479
2、cd 到解压目录
3、创建mysql 组与用户

mysql>groupadd mysql  
mysql>useradd -r -g mysql -s /bin/false mysql  

4、按需要设置权限
5、安装

mysql>bin/mysqld --initialize --user=mysql  

提示信息

2018-01-04T06:48:24.652569Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).  
2018-01-04T06:48:24.881794Z 0 [Warning] InnoDB: New log files created, LSN=45790  
2018-01-04T06:48:25.097948Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.  
2018-01-04T06:48:25.357248Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 434c44cb-f11b-11e7-b768-005056a5b865.  
2018-01-04T06:48:25.357880Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.  
2018-01-04T06:48:25.358546Z 1 [Note] A temporary password is generated for root@localhost: QRdOjg,Y<0Hk  
QRdOjg,Y<0Hk 为初始密码 

也可用下面的命令获取初始密码:

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

6、启动

mysql>./support-files/mysql.server start  

7、登录

mysql>./bin/mysql -u 【用户名】 -p【密码】 

8、首次登录重设密码

mysql>Alter user 'root'@'localhost' identified by 'root';

9、远程连接需要可能需要关闭防火墙
添加需要监听的端口

mysql>/sbin/iptables -I【是i,需要删除这个中括号】 INPUT -p tcp --dport 3306 -j ACCEPT

保存设置

mysql>/etc/init.d/iptables save  

查看状态

mysql>/etc/init.d/iptables status  

若有凝问或错误,请指出,我好及时改正,让我们一起进步!
email : binary_space@126.com
qq : 103 586 2795
敲门砖: 代码谱写人生

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值