rpm方式安装mysql-5.7.11
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                rpm方式安装mysql-5.7.11
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                1、rpm bundel包下載到 /usr/local/src中:
[root@localhost?src]#?ls mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar2解壓縮bundle包
[root@localhost?src]#?tar?xf?mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar? [root@localhost?src]#?ls mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar mysql-community-client-5.7.11-1.el6.x86_64.rpm mysql-community-common-5.7.11-1.el6.x86_64.rpm mysql-community-devel-5.7.11-1.el6.x86_64.rpm mysql-community-embedded-5.7.11-1.el6.x86_64.rpm mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm mysql-community-libs-5.7.11-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm mysql-community-server-5.7.11-1.el6.x86_64.rpm mysql-community-test-5.7.11-1.el6.x86_64.rpm安裝必須組件:
yum?install?numactl yum?install?libaio yum?install?perl-Time-HiRes?per-devel?
3.安裝mysql-community-server之前,必須安裝mysql-community-client和mysql-community-common ?rpm包。而安裝community-client和community-common包之前,必須刪除mysql-lib(系統自帶的版本過低)
[root@localhost?src]#?rpm?-qa?|?grep?mysql mysql-libs-5.1.73-3.el6_5.x86_64[root@localhost?src]#?yum?remove?mysql-libs Loaded?plugins:?fastestmirror,?refresh-packagekit,?security Existing?lock?/var/run/yum.pid:?another?copy?is?running?as?pid?19475. Another?app?is?currently?holding?the?yum?lock;?waiting?for?it?to?exit...The?other?application?is:?PackageKitMemory?:??39?M?RSS?(569?MB?VSZ)Dependencies?Resolved===========================================================================================Package??????????????????????????????Arch?????????????????????????Version????????????????????????????????Repositor =================================================================================================================== Removing:mysql-libs???????????????????????????x86_64???????????????????????5.1.73-3.el6_5?????????????????????????@anaconda Removing?for?dependencies:cronie???????????????????????????????x86_64???????????????????????1.4.4-12.el6???????????????????????????@anacondacronie-anacron???????????????????????x86_64???????????????????????1.4.4-12.el6???????????????????????????@anacondacrontabs?????????????????????????????noarch???????????????????????1.10-33.el6????????????????????????????@anacondapostfix??????????????????????????????x86_64???????????????????????2:2.6.6-6.el6_5????????????????????????@anacondasysstat??????????????????????????????x86_64???????????????????????9.0.4-27.el6???????????????????????????@anacondaTransaction?Summary =================================================================================================================== Remove????????6?Package(s)Installed?size:?15?M Is?this?ok?[y/N]:?y Downloading?Packages: Running?rpm_check_debug Running?Transaction?Test Transaction?Test?Succeeded Running?TransactionErasing????:?sysstat-9.0.4-27.el6.x86_64?????????????????????????????????????????????????????????????????????????Erasing????:?cronie-1.4.4-12.el6.x86_64??????????????????????????????????????????????????????????????????????????Erasing????:?cronie-anacron-1.4.4-12.el6.x86_64??????????????????????????????????????????????????????????????????Erasing????:?crontabs-1.10-33.el6.noarch?????????????????????????????????????????????????????????????????????????Erasing????:?2:postfix-2.6.6-6.el6_5.x86_64??????????????????????????????????????????????????????????????????????Erasing????:?mysql-libs-5.1.73-3.el6_5.x86_64????????????????????????????????????????????????????????????????????Verifying??:?cronie-anacron-1.4.4-12.el6.x86_64??????????????????????????????????????????????????????????????????Verifying??:?mysql-libs-5.1.73-3.el6_5.x86_64????????????????????????????????????????????????????????????????????Verifying??:?sysstat-9.0.4-27.el6.x86_64?????????????????????????????????????????????????????????????????????????Verifying??:?crontabs-1.10-33.el6.noarch?????????????????????????????????????????????????????????????????????????Verifying??:?cronie-1.4.4-12.el6.x86_64??????????????????????????????????????????????????????????????????????????Verifying??:?2:postfix-2.6.6-6.el6_5.x86_64??????????????????????????????????????????????????????????????????????Removed:mysql-libs.x86_64?0:5.1.73-3.el6_5???????????????????????????????????????????????????????????????????????????????Dependency?Removed:cronie.x86_64?0:1.4.4-12.el6????cronie-anacron.x86_64?0:1.4.4-12.el6????crontabs.noarch?0:1.10-33.el6????postfix.Complete!?
?
4.上面卸載了mysql-lib舊的包,現在安裝mysql-lib最新版的文件,這個包在rpm-bundle里面都有,
直接安裝即可
[root@localhost?src]#?rpm?-ivh?mysql-community-common-5.7.11-1.el6.x86_64.rpm? warning:?mysql-community-common-5.7.11-1.el6.x86_64.rpm:?Header?V3?DSA/SHA1?Signature,?key?ID?5072e1f5:?NOKEY Preparing...????????????????###########################################?[100%]1:mysql-community-common?###########################################?[100%] [root@localhost?src]#?ls mysql-5.7.11-1.el6.x86_64.rpm-bundle.tar????????mysql-community-embedded-5.7.11-1.el6.x86_64.rpm????????mysql-commu mysql-community-client-5.7.11-1.el6.x86_64.rpm??mysql-community-embedded-devel-5.7.11-1.el6.x86_64.rpm??mysql-commu mysql-community-common-5.7.11-1.el6.x86_64.rpm??mysql-community-libs-5.7.11-1.el6.x86_64.rpm mysql-community-devel-5.7.11-1.el6.x86_64.rpm???mysql-community-libs-compat-5.7.11-1.el6.x86_64.rpm [root@localhost?src]#?rpm?-ivh?mysql-community-libs-5.7.11-1.el6.x86_64.rpm? warning:?mysql-community-libs-5.7.11-1.el6.x86_64.rpm:?Header?V3?DSA/SHA1?Signature,?key?ID?5072e1f5:?NOKEY Preparing...????????????????###########################################?[100%]1:mysql-community-libs???###########################################?[100%] [root@localhost?src]#?rpm?-ivh?mysql-community-client-5.7.11-1.el6.x86_64.rpm? warning:?mysql-community-client-5.7.11-1.el6.x86_64.rpm:?Header?V3?DSA/SHA1?Signature,?key?ID?5072e1f5:?NOKEY Preparing...????????????????###########################################?[100%]1:mysql-community-client?###########################################?[100%] [root@localhost?src]#?rpm?-ivh?mysql-community-server-5.7.11-1.el6.x86_64.rpm? warning:?mysql-community-server-5.7.11-1.el6.x86_64.rpm:?Header?V3?DSA/SHA1?Signature,?key?ID?5072e1f5:?NOKEY Preparing...????????????????###########################################?[100%]1:mysql-community-server?###########################################?[100%]?
5.啟動mysql 服務
[root@localhost?src]#?service?mysql?start mysql:?unrecognized?service [root@localhost?src]#?service?mysqld?start Initializing?MySQL?database:???????????????????????????????[??OK??] Installing?validate?password?plugin:???????????????????????[??OK??] Starting?mysqld:???????????????????????????????????????????[??OK??] [root@localhost?src]#?netstat?-tlunp Active?Internet?connections?(only?servers) Proto?Recv-Q?Send-Q?Local?Address???????????????Foreign?Address?????????????State???????PID/Program?name??? tcp????????0??????0?0.0.0.0:22??????????????????0.0.0.0:*???????????????????LISTEN??????1525/sshd??????????? tcp????????0??????0?127.0.0.1:631???????????????0.0.0.0:*???????????????????LISTEN??????1384/cupsd?????????? tcp????????0??????0?:::22???????????????????????:::*????????????????????????LISTEN??????1525/sshd??????????? tcp????????0??????0?::1:631?????????????????????:::*????????????????????????LISTEN??????1384/cupsd?????????? tcp????????0??????0?:::3306?????????????????????:::*????????????????????????LISTEN??????19928/mysqld???????? udp????????0??????0?0.0.0.0:68??????????????????0.0.0.0:*???????????????????????????????19346/dhclient?????? udp????????0??????0?0.0.0.0:631?????????????????0.0.0.0:*???????????????????????????????1384/cupsd?
?
?
6.rpm安裝mysql后,會自動初始化一個密碼,在日志中
[root@localhost?src]#?cat?/var/log/mysqld.log?|?more 2016-03-11T01:44:19.913630Z?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--ex plicit_defaults_for_timestamp?server?option?(see?documentation?for?more?details). 2016-03-11T01:44:22.271099Z?0?[Warning]?InnoDB:?New?log?files?created,?LSN=45790 2016-03-11T01:44:22.584299Z?0?[Warning]?InnoDB:?Creating?foreign?key?constraint?system?tables. 2016-03-11T01:44:23.050146Z?0?[Warning]?No?existing?UUID?has?been?found,?so?we?assume?that?this?is?the?firsttime?that?this?server?has?been?started.?Generating?a?new?UUID:?c7bf1a6a-e72a-11e5-8737-000c29a05942. 2016-03-11T01:44:23.062259Z?0?[Warning]?Gtid?table?is?not?ready?to?be?used.?Table?'mysql.gtid_executed'?cann ot?be?opened. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++2016-03-11T01:44:23.093873Z?1?[Note]?A?temporary?password?is?generated?for?root@localhost:?8%<rjn;+,11Y+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2016-03-11T01:44:28.470492Z?0?[Warning]?TIMESTAMP?with?implicit?DEFAULT?value?is?deprecated.?Please?use?--ex plicit_defaults_for_timestamp?server?option?(see?documentation?for?more?details). 2016-03-11T01:44:28.471726Z?0?[Note]?/usr/sbin/mysqld?(mysqld?5.7.11)?starting?as?process?19672?... 2016-03-11T01:44:28.626135Z?0?[Note]?InnoDB:?PUNCH?HOLE?support?available 2016-03-11T01:44:28.626205Z?0?[Note]?InnoDB:?Mutexes?and?rw_locks?use?GCC?atomic?builtins 2016-03-11T01:44:28.626220Z?0?[Note]?InnoDB:?Uses?event?mutexes 2016-03-11T01:44:28.626233Z?0?[Note]?InnoDB:?GCC?builtin?__sync_synchronize()?is?used?for?memory?barrier?
?
?
?
7.修改 mysql root密碼,由于最新的mysql版本對密碼策略有要求,所以必須增加復雜程度才能通過
注意,用剛才的隨機密碼登陸mysql.
[root@localhost?src]#?mysql?-uroot?-p Enter?password:?此處輸入剛才日志文件中的隨機密碼 Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?14 Server?version:?5.7.11Copyright?(c)?2000,?2016,?Oracle?and/or?its?affiliates.?All?rights?reserved.Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners.Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement.mysql>?set?password='Yes@126.com'; Query?OK,?0?rows?affected?(0.15?sec)mysql>?quit; Bye[root@localhost?src]#?mysql?-uroot?-p Enter?password:? Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?15 Server?version:?5.7.11?MySQL?Community?Server?(GPL)Copyright?(c)?2000,?2016,?Oracle?and/or?its?affiliates.?All?rights?reserved.Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners.Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement.?
?
?
?
?
默認情況下,mysql只允許locathost本地登陸,用mysql workbentch 是無法遠程登陸的。
root@localhost,代表root只允許本地用戶登陸,
所以必須允許root 從任何ip地址登陸。
mysql>?grant?all?privileges?on?*.*?to?'root'@'%'?identified?by?'Yes@126.com';總結
以上是生活随笔為你收集整理的rpm方式安装mysql-5.7.11的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: Linux中添加、修改、删除用户和用户组
- 下一篇: C++基本内置类型
