查看版本:
[sparkadmin@hadoop3 ~]$ lsb_release -a
lsb version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
distributor id: centos
description: centos release 6.7 (final)
release: 6.7
codename: final
centos默认通过yum 只能安装mysql 5.1
1. 查看系统里面有没有mysql 的repo
# yum repolist all | grep mysql
2. 如果没有发现,则需要配置repo
#vim /etc/yum.repos.d/mysql-community.repo
# enable to use mysql 5.6
[mysql56-community]
name=mysql 5.6 community server
baseurl=https://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql
3. 再看看是否存在mysql的repo
# yum repolist enabled | grep mysql
mysql56-community mysql 5.6 community server 214
4、安装
# yum install mysql-community-server
如果安装过程中报错,没有安装成功:
warning: rpmts_hdrfromfdno: header v3 dsa/sha1 signature, key id 5072e1f5: nokey
解决方法:
# vim /etc/pki/rpm-gpg/rpm-gpg-key-mysql
添加下面的内容:
-----begin pgp public key block-----
version: gnupg v1.4.9 (sunos)
mqgibd4+owwrbac14gifufcyedsiepvew3safudjbtoqhh/njkzyqt7h9bpluwc3
rodjqreycitrrdwyrkugku2fmevgwn2u2wmdmnablnpprwpkbdck96+omsln9brz
fw2vougcmyv2hw0hydhuvylqa/bthqoadgj8aw6/0lo7v1w9/8vuhp0gqwcgvzv3
bqoxrznncrcrxauauvzthrceajooqk1+isiunzmyd1wufexfshc57s/+yejkegnw
hxwr9prwvarnyjddrt+rf2rue3vpquknqu/hneiuhjrqqyho8gtxvxxnqc7fjylv
k2htkrpbp72vwsekmyhhr0ekcbtlgfls9krjj6sbgacyp/vb7hipwxh6rdz7itne
kypxbacmwpp8njtkamenpcia2zoohodanwpukp43i7jsdmgtobzx9qnraxw+undi
qjexm6fsbi0lltzcinlysafwapeomdkpmqak6iyisntpvald8lh0bpanwqcyefep
rv0sxxquemcm3o7wwgfn83pokdasdbs3pjwphxvhz6//62zqj7q2txltuuwgumvs
zwfzzsbfbmdpbmvlcmluzya8bxlzcwwtynvpbgrab3nzlm9yywnszs5jb20+igke
execackcgymgcwkibwmcbbuccamefgidaqieaqixgaizaqucuwhuzgujgmblywak
crcmcy07uhlh9v+dakcjs1ggwgvi/eut+5l+l2v3ybl+zgccd7zoa341htorov3u
6xrd09fugeq0o015u1fmifbhy2thz2ugc2lnbmluzybrzxkgkhd3dy5texnxbc5j
b20pidxidwlszebtexnxbc5jb20+ig8embecac8fak53pa0ohsbidwlszebtexnx
bc5jb20gd2lsbcbzdg9wihdmtpbmcgc29vbgakcrcmcy07uhlh9bu9aj9xdk0o
xjfl9vtl9oszc4lx0k9azwcccrs9cnjyz79earjl0s2r/ccljdyizqqteqiahquc
r6yutaujdtbyqaulbwodbamvawidfgibaheaabijeixxjttqcuh1b2vhuecaaqgu
kgcffz4guejzxkoi71vcwgcxastgbe0an34lpr1j9fcbrxwxo14msiadfb5piewe
execaawfaj4+o9efgwlmalsacgkqsvdhkrjykfik4qcfwbeekn+3trspe+5xkj+k
qjsammianjuz0xfwplvx0f8o38qng1bq0cu9ieweexecaawfaj5cggmfgwliioka
cgkqtvxntca6jd+wkqcgigmnogjmojynp5ppvmxkyukfnykaok79e6h8rwksdzou
iz7nmrish8uyieyeebecaayfaj+s468acgkqr8ujshidda/2lgcg21ihimmabtyd
p/ibiusp/jqlieoanrzmywetujqz/e9ono7h1dkebda4ieyeebecaayfaj+0q3ca
cgkqhzavqzbztmbgwwcdfqd1frvic7wrt8gkoos7hznn32kanirlbwpnt7a6nosq
83nk11a2dephieyeebecaayfaknbs+oacgkqi9gubzc5s1x/dacdelkoxqkkwjn0
gzztsm7kjsigyfmanrrmbhq7v39xc90oipapjk3a01tgieyeexecaayfaktxmyya
cgkq9kne9gctuwwkcqcgibak/swhxwh1ijrhgyco5gtm4vcanahtzl57wcw1kg1x
m7nvgetuqj7fieweebecaawfakgbywefgwyi2ysacgkqgfnqh2d7oexcjqccd8sj
ndc/ms8m8ogduox9vmwcngkanj1ywod+qhxo3mi/ul9oeahnkjcfieweebecaawf
akgbyzqfgwyi2vgacgkqgcl36+ittpiiiwcdfvnvub8xe8mfxopm4d9z54ptjpma
nispa/zsfj3oomlkar4f0qpprdrgieweebecaawfakgby2ifgwyi2soacgkqa3ds
2v3d9hmjqgcbbyzr5gpxoxgp88jkzmdbjweqxeeanrss4g2g/3qd7uhtl1spt1sh
jwuxieweebecaawfakhqkyqfgwxuewgacgkqfsxkcsepp8jivqcghvwvkpqowsw8
w7wssetcw1tflvkani+vlhl/dqily0lkzyn5jzk1dpvfieweebecaawfakirw7of
gwv5sniacgkq5hukirxruavzewcgkzl5qklsypcw9lghcfsx1ya0vl4an35nxkum
g6ccj1np8r2i4nczwirqieweehecaawfakaqwtofgwd6s1iacgkqpkefnjt6+gem
xaccd+a53a5ogm7w750w11ukq4iz9ckanrmvndaqn3ytoxxllpj2upzisgsqiewe
ehecaawfaka9+rofgwdmqdiacgkq8tdcy+oczzyy3wcgtdcwlaq20w0cnuxfllne
euafftwani6rhn80mosvaddtrkzzacju3m5qieweehecaawfakeocoqfgwawmgga
cgkqocor9d1qil/83qceitz9wio7xamjc6y4zwul4m+edzsaomohriri42fmrnfu
vnzbnmgej81vieweehecaawfakkaptqfgwuj/1gacgkqba3ahxydn6jjjaccd1a4
utxk84j13jqyoh9+dy24714aniwlsso/9ndicjokqs2j5dlhfq6oieweexecaawf
aj5ntyqfgwlxvwgacgkqlbt2v63uytmfdacglt5g5nvkf5mj65bfslpzb92zk2qa
n1uc2h19/iwwrsbiyk/9poj+jmp7ieweexecaawfakhxghyfgwxnjbyacgkqzu/b
ym2c/t4/vacfxe67xishb80wkmfz2krb+oz/gbaanjr2ucpbaonkqqgnc3gnbqmc
vnajieweexecaawfakiygq4fgwwmi34acgkqdsedhkixbqgg7gcfqi2hcrhn+ylf
unlh1osoh48zm0oan3hkv0uirjphonhauyiup1ttwgdbigueexecab0fcwckawqd
fqmcaxycaqixgaucs3avygujeppzpwasb2vhuecaaqejeixxjttqcuh1snsaniyp
ybgqy/hhmnw3we8kxahoor5kaj4xumwpgyp4l3hkxynk9oaubpdvyih7bdaraga7
bqjcdzx1nb0at29wcy4ulibzag91bgqgagf2zsbizwvuigxvy2fsisbjj20gknnv
kibzdhvwawquli4acgkqocor9d1qil/vrwcdfo08f66okliueaqzlf9idlpozeea
n2egvcylcchjfgosrkru3wk5nfvgii8embecae8fakvval9ihqbtag91bgqgagf2
zsbizwvuigegbg9jywwgc2lnbmf0dxjllcbvcibzb21ldghpbmcglsbxveygd2fz
iekgdghpbmtpbmc/aaojednkk/q9aopfopsan3bvqkoaljef0xpsvlr90psrlnmg
aj44oisy7tl3njbpgzal8w32fbqgbikcigqqaqiadaucqyhlhqwdbilzbwakcrcq
4+bozqfeakgveaccernahgyuya0wetjj6dlexsqeoixad4i9abqxnd35gugcfofc
/ncy4xcncmmenmdq9ofuuu3obj6bnjibeusaabglooebp/3keaiciiyhhyu5jarp
zah+zopgs3oc11mq1tias69ijxrgtlodkasajaeeuwtpq9fhffzc1egbysoyfwg4
bijz/zcli+qytbfa5g6troixto8ko7qhy2aa5ugeg+83hdb6akc04z2qrerxkaqr
phhzj8xpjvosqadai/qvkqenkrolj+iq6+yesmcwgfzeb87dgnwevfdjiga0qy27
ptb2lexyjsrfn4cb13nfodabmtoxcawz7japcxaplhug++mhmrhqxetoznbfe4nb
nc7vobngwdjugxcpkuckop4b17bfpr+k8ztylss8p2llz4uaeccsm2/msjxt7rc/
fvoh8428ohincqs2ico9zo/ud4hmmo0o+sszdvkiijingyovwb4oozkalnnhez3o
6hahcreisbgpweyvtj/9zdc0ao44nj9cu7awaqgtrnwwfr/o4v2gl8blskltzu27
/29heuoefgjlfe0yrdd/arnsxbyb2o28h4sg1cvzmc5uk1iqbdisya7q0bbdofcw
oqzm5twlpkwny8oe0ub9xp5p/svfck4fcewfhwv+/pc9rzsl33lq6vm2wikcigqt
aqiadaucqp8khawdbqwacaakcrdywgojwirxzye+d/9uc7z6fisalfoyoln60aja
bqbi/urkbfugyz5roaitusn9z2ratn61wrfhu4ucsjtfn1ny2rerg40f56ptghkr
d+yet+nze6+fkq5abgidfsr/2buk+zzrst83e14lcb6ii/fjfzkoiox9ltkifqxq
y7tvk4noku4olsc8o1wsfc/y0b9syuucmufcnq58demgie9ovuslmyt5npnvexxp
5uearc5rqt9tk2b4a+7/cqenrdzjbamsunt2+2fkyirunafpkpbdjbsy1sxel/a9
ake0vikexqdawqdnzknci8rd/oop99/9lmbfudabx6nl2dsb1og2z7nweqgiazjm
pwyypckevz5q8r+if9/fe5+sty/55oai33fj2h3v+u435vjyqbrerwe36xjitcje
quzw71fqtxi1ctel3w2ch7vf5oj/qyjablnalhgslksi6p7by5c2mnbchlcfpnii
nphforcrgpjje9nfwgs+qblvs/chzc2wx3s/2swm4geukrx4zsaj5ocyfa/vkxck
sxk/erwlcpf/j1t70+i5waxdn/e3enset/wl7h94pqkpjz8odgl4jsbhuavga+a+
dknqnpf0kmklhjrgv+l7o84fhbmap7pxm3xmimprixf+el5fzzequqoiagf8rdrh
hhrjxqgi0hnknkaoqs8dtrkcdqq+pqmdeaga7+gjfxbmdy4wslpnjh9rf4n2qfws
en/lxazojyc3a6m02wcnhl6aht2/tbk2w1qi4yfter47gcvtgb6o1jhffoo2hflm
rdrirjd1dtchqeyx7chhcghj/dnrlw2z0l5qfecmv9u0vhp3affwc4ujfs3lu+hk
awze7zad5ch9j7yv/6xuzvw411x0h4uqstcwmu0im1bzelqx1dy7lwopeb/o9rkb
f4fmle11eziaca4pqarxqzc4dhsinmt6k3x4brrsktfozbu74f47d8ilbf5vsyhb
ue5p/1oidznkg/p8kw+3fxuwrycciqftcnz215yyx39lxfnllzkub/f5gwadbqf+
lwqqa8cgrrfsoajxim63chfty5muc5rusntslgyeiocr1beqauypzbpdsdd9mz1z
asafanfvwfg6llx9xku7tzq+vklowkm4u5xf3vn55vjnsd1aq9eqnucxil4cnbgo
tbowi39ecyzgslzbdc++mpjcqtca7p6juvsp6oab3fqwg54tuuo0ec8bsm8b3ev4
2lmuqt5ndkhgwhsxtptl0klk4bqk4oajhsiy1bmahpt27jwjjlmijc+iwj0mghkk
ht926s/ymfdf5hkdq1cyvsz5tryvi3fx78xesyfqvuuwqp2h139pxgekg0n6kduo
etdzwhe70ygnpw1yjwjt1ihubbgragambqjodz3tbqkt+wg4abihzudqrwabaqkq
jhgno1by4fuumwcbbyr2+bben/l2bocnw9z/qfwuhrmaokvgcfm5fadq3afi+uql
acophrnj
=443i
-----end pgp public key block-----
继续安装:
# yum install mysql-community-server
现在就成功的安装了mysql。
如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!