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

本文內容爲轉載內容,具體做者忘記是誰了,在收藏夾找到的php

 

  先去官網(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下,接着執行以下命令mysql

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 #查看系統位數
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

以下所示sql

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>) 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

接着執行以下命令服務器

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
相關文章
相關標籤/搜索