Linux(Ubuntu)下mysql5.7.17裝置配置辦法圖文教程。本站提示廣大學習愛好者:(Linux(Ubuntu)下mysql5.7.17裝置配置辦法圖文教程)文章只能為提供參考,不一定能成為您想要的結果。以下是Linux(Ubuntu)下mysql5.7.17裝置配置辦法圖文教程正文
前言
後面裝置過mysql5.6,時隔三個月,開發那邊反應需求在MySQL中處置JSON類型的數據,檢查文檔,JSON是在5.7支持的新特性。於是著手裝置Mysql57
Mysql5.6.28的裝置:
裝置
若運用apt-get install mysql-server停止裝置,默許裝置的不是最新的版本,於是思索去官網找一個最新的社區版本。
1.獲取最新的Mysql版本
在 https://dev.mysql.com/downloads/mysql/ 下選擇操作零碎版本(本例為Ubuntu),下載的時分留意要和操作零碎版本相婚配(OS版本對應裝置包版本)。
# cat /etc/issue Ubuntu 12.04.5 LTS \n \l # wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar
2.詳細裝置(由於依賴報的關系,需求留意裝置次第)
# tar -xvf mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar # ll total 712948 drwxr-xr-x 2 root root 4096 Jan 20 10:07 ./ drwxr-xr-x 5 root root 4096 Jan 19 19:23 ../ -rw-r--r-- 1 7155 31415 1356802 Nov 29 03:30 libmysqlclient20_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 1904116 Nov 29 03:30 libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 30791660 Nov 29 03:29 libmysqld-dev_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 12998 Nov 29 03:30 mysql-client_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 82798 Nov 29 03:30 mysql-common_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 6831 Nov 29 03:30 mysql-community_5.7.17-1ubuntu12.04_amd64.changes -rw-r--r-- 1 7155 31415 21519804 Nov 29 03:30 mysql-community-client_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 55477882 Nov 29 03:29 mysql-community-server_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 208582030 Nov 29 03:30 mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 45244026 Nov 29 03:30 mysql-community-test_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 7155 31415 12990 Nov 29 03:30 mysql-server_5.7.17-1ubuntu12.04_amd64.deb -rw-r--r-- 1 root root 365015040 Nov 30 02:11 mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar -rw-r--r-- 1 7155 31415 13014 Nov 29 03:30 mysql-testsuite_5.7.17-1ubuntu12.04_amd64.deb ###裝置依賴包 sudo apt-get upgrade sudo apt-get install libaio1 ###裝置deb包 sudo dpkg -i mysql-common_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i libmysqlclient20_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i libmysqld-dev_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i mysql-community-client_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i mysql-client_5.7.17-1ubuntu12.04_amd64.deb sudo dpkg -i mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb ###libmecab2 裝置 sudo apt-get -f install sudo dpkg -i mysql-community-server_5.7.17-1ubuntu12.04_amd64.deb ###這邊會提示設置root密碼
根本配置(和以前的5.6版本有差別)
1.新增用戶,賦權
create user testuser identified by '*******'; create database testdb; GRANT ALL ON testdb.* TO 'testuser'@'%' ; flush privileges; --root用戶近程訪問權限開放 mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select host,user from user; +-----------+-----------+ | host | user | +-----------+-----------+ | % | testuser | | localhost | mysql.sys | | localhost | root | +-----------+-----------+ 3 rows in set (0.00 sec) mysql> update user set host = '%' where user ='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select host,user from user; +-----------+-----------+ | host | user | +-----------+-----------+ | % | testuser | | % | root | | localhost | mysql.sys | +-----------+-----------+ 3 rows in set (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
2.配置文件修正
配置文件途徑(相比以前版本有變卦,56途徑:/etc/MySQL/my.conf)
57途徑: /etc/mysql/mysql.conf.d/mysqld.cnf
--綁定IP修正
找到bind-address = 127.0.0.1這一行
改為bind-address = 0.0.0.0,問題處理。
--大小寫區分修正
[mysqld]後添加添加lower_case_table_names=1,重啟MYSQL服務,這時已設置成功:不區分表名的大小寫;
lower_case_table_names參數詳解:
lower_case_table_names = 0
其中 0:區分大小寫,1:不區分大小寫
其他
根本的服務啟停命令沒有改動
# 啟動MySQL$ sudo service mysql start # 封閉MySQL$ sudo service mysql stop # 重啟MySQL$ sudo service mysql restart # 其他命令:$ sudo /etc/init.d/mysql start $ sudo /etc/init.d/mysql stop $ sudo /etc/init.d/mysql restart
精彩專題分享:mysql不同版本裝置教程 mysql5.7各版本裝置教程 mysql5.6各版本裝置教程
以上就是本文的全部內容,希望對大家的學習有所協助,也希望大家多多支持。