CentOS6.5安装mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar

        先去官网(https://dev.mysql.com/downloads/mysql/),在Select Operating System选择Red Hat Enterprise Linux / Oracle Linux,在Select OS Version选择Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 64-bit),下载RPM Bundle
        将下载的文件上传到服务器/usr/local下,接着执行如下命令

rpm -qa|grep mysql #查看mysql是否安装,如果已经安装需要卸载,如果是
yum -y remove mysql-libs-5.1.71-1.el6.x86_64 
 #卸载
cd /usr/local/ #指定目录
tar -xvf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
 #解压
rpm -ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm
yum install perl #安装server时需要的依赖包
yum install numactl #安装server时需要的依赖包
yum install libaio #安装时需要的依赖包
rpm -ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm
service mysqld start #启动mysqld服务
netstat -tlunp #查看服务所需端口
cat /var/log/mysqld.log | more #查看日志,找初始密码
cat /etc/issue #查看系统版本
getconf LONG_BIT #查看系统位数

如下所示

2017-06-16T04:48:19.788616Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-16T04:48:22.099994Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-06-16T04:48:22.332387Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-06-16T04:48:22.405922Z 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: 068f9e70-524f-11e7-80fb-000c297c9986.
2017-06-16T04:48:22.409115Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-06-16T04:48:22.410417Z 1 [Note] A temporary password is generated for root@localhost: dee5h,lqSA>)

接着执行如下命令

mysql -uroot -pdee5h,lqSA>)
alter user 'root'@'localhost' identified by 'Mysql@123456'; #设置root的密码为Mysql@123456
use mysql;
update user set user.Host='%' where user.User='root';
flush privileges;
exit;
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT #配置端口3306
/etc/rc.d/init.d/iptables save #保存配置
/etc/init.d/iptables restart #重启防火墙iptables
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值