MySQL 5.6.23升級到MySQL 5.7.9

來源:互聯網
上載者:User

MySQL 5.6.23升級到MySQL 5.7.9

MySQL 5.6.23升級到MySQL 5.7.9

MySQL 5.7.9新特性

一、安全性

1.1. 使用者表 mysql.user 的 plugin欄位不允許為空白, 預設值是 mysql_native_password,而不是 mysql_old_password,不再支援舊密碼格式;

1.2. 增加密碼到期機制,到期後需要修改密碼,否則可能會被禁用,或者進入沙箱模式;

1.3. 使用mysqld --initialize 初始化,預設會自動產生隨機密碼,並且不建立除 root@localhost 外的其他帳號,也不建立 test 庫;

改成 mysqld --initialize 後,如果 datadir 指向的目標目錄下已經有資料檔案,則會有類似提示:

2015-11-20T17:03:38.200709Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. 

2015-11-20T17:03:38.200807Z 0 [ERROR] Aborting

因此,需要先確保 datadir 目標目錄下是空的,避免誤操作破壞已有資料。

二.升級

2.1.解壓tar -zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz

2.2.將5.7.9版本放到預設目錄下面

mv mysql-5.7.9-linux-glibc2.5-x86_64 /usr/local/mysql

關閉mysql5.6.23資料庫  service mysql stop

2.3.修改/etc/my.cnf 的資料路徑,現有資料庫mysql5.6.23已經跑業務 資料放在 /mnt/sda4/mysql5.6.23/data

datadir = /mnt/sda4/mysql5.6.23/data       

2.4.啟動service mysql start

2.5.嘗試插入並查看資料查看是否正常

[root@sam tt]# /usr/local/mysql/bin/mysql -uroot -h127.0.0.1 test -e "select * from  dsp_monitors where time='2015-11-19 14:03:00';"

+----+----------+----------+-----------+---------------------+--------------+---------------+---------------+----------+

| id | exchange | flowType | size      | time                | requestCount | filteredCount | outPriceCount | bidCount |

+----+----------+----------+-----------+---------------------+--------------+---------------+---------------+----------+

|  1 | tt    | desktop  | 250X250FC | 2015-11-19 14:03:00 |            0 |        431884 |            0 |        0 |

|  2 | tt    | desktop  | 250X250FC | 2015-11-19 14:03:00 |            0 |        431884 |            0 |        0 |

+----+----------+----------+-----------+---------------------+--------------+---------------+--

本文永久更新連結地址:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.