今天看啥
热点:

CentOS 6.5上安装MariaDB


1、软件环境:

CentOS 6.5 x64
MariaDB 5.5.36

2、安装过程

1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下:
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #MariaDB5.5CentOSrepositorylist-created2014-03-0411:20UTC
  2. #http://mariadb.org/mariadb/repositories/
  3. [mariadb]
  4. name=MariaDB
  5. baseurl=http://yum.mariadb.org/5.5/centos6-amd64
  6. gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  7. gpgcheck=1

2)在Shell环境下执行命令
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #yuminstallMariaDB-serverMariaDB-client
  2. Loadedplugins:fastestmirror,security
  3. base|3.7kB00:00
  4. base/primary_db|4.4MB01:11
  5. extras|3.4kB00:00
  6. extras/primary_db|19kB00:00
  7. mariadb|1.9kB00:00
  8. mariadb/primary_db|15kB00:00
  9. updates|3.4kB00:00
  10. updates/primary_db|2.1MB00:22
  11. SettingupInstallProcess
  12. ResolvingDependencies
  13. -->Runningtransactioncheck
  14. --->PackageMariaDB-client.x86_640:5.5.36-1.el6willbeobsoleting
  15. -->ProcessingDependency:MariaDB-commonforpackage:MariaDB-client-5.5.36-1.el6.x86_64
  16. --->PackageMariaDB-server.x86_640:5.5.36-1.el6willbeobsoleting
  17. --->Packagemysql.x86_640:5.1.71-1.el6willbeobsoleted
  18. --->Packagemysql-server.x86_640:5.1.71-1.el6willbeobsoleted
  19. -->Runningtransactioncheck
  20. --->PackageMariaDB-common.x86_640:5.5.36-1.el6willbeinstalled
  21. -->ProcessingDependency:MariaDB-compatforpackage:MariaDB-common-5.5.36-1.el6.x86_64
  22. -->Runningtransactioncheck
  23. --->PackageMariaDB-compat.x86_640:5.5.36-1.el6willbeobsoleting
  24. --->Packagemysql-libs.x86_640:5.1.71-1.el6willbeobsoleted
  25. -->FinishedDependencyResolution
  26. DependenciesResolved
  27. ==================================================================================================================
  28. PackageArchVersionRepositorySize
  29. ==================================================================================================================
  30. Installing:
  31. MariaDB-clientx86_645.5.36-1.el6mariadb10M
  32. replacingmysql.x86_645.1.71-1.el6
  33. MariaDB-compatx86_645.5.36-1.el6mariadb2.7M
  34. replacingmysql-libs.x86_645.1.71-1.el6
  35. MariaDB-serverx86_645.5.36-1.el6mariadb42M
  36. replacingmysql-server.x86_645.1.71-1.el6
  37. Installingfordependencies:
  38. MariaDB-commonx86_645.5.36-1.el6mariadb23k
  39. TransactionSummary
  40. ==================================================================================================================
  41. Install4Package(s)
  42. Totaldownloadsize:55M
  43. Isthisok[y/N]:y
  44. DownloadingPackages:
  45. (1/4):MariaDB-5.5.36-centos6-x86_64-client.rpm|10MB04:45
  46. (2/4):MariaDB-5.5.36-centos6-x86_64-common.rpm|23kB00:00
  47. (3/4):MariaDB-5.5.36-centos6-x86_64-compat.rpm|2.7MB01:02
  48. (4/4):MariaDB-5.5.36-centos6-x86_64-server.rpm|42MB17:44
  49. ------------------------------------------------------------------------------------------------------------------
  50. Total40kB/s|55MB23:34
  51. warning:rpmts_HdrFromFdno:HeaderV4DSA/SHA1Signature,keyID1bb943db:NOKEY
  52. Retrievingkeyfromhttps://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  53. ImportingGPGkey0x1BB943DB:
  54. Userid:"DanielBartholomew(MontyProgramsigningkey)<[email protected]>"
  55. From:https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  56. Isthisok[y/N]:y
  57. Runningrpm_check_debug
  58. RunningTransactionTest
  59. TransactionTestSucceeded
  60. RunningTransaction
  61. Installing:MariaDB-compat-5.5.36-1.el6.x86_641/7
  62. Installing:MariaDB-common-5.5.36-1.el6.x86_642/7
  63. ErrorinPREINscriptletinrpmpackageMariaDB-server-5.5.36-1.el6.x86_64
  64. ******************************************************************
  65. AMySQLorMariaDBserverpackage(mysql-server-5.1.71-1.el6.x86_64)isinstalled.
  66. ThecurrentMariaDBserverpackageisprovidedbyadifferent
  67. vendor(CentOS)thanMontyProgramAB.Somefilesmaybeinstalled
  68. todifferentlocations,includinglogfilesandtheservice
  69. startupscriptin/etc/init.d/.
  70. UpgradingdirectlyfromMySQL5.1toMariaDB5.5maynot
  71. besafeinallcases.Amanualdumpandrestoreusingmysqldumpis
  72. recommended.ItisimportanttoreviewtheMariaDBmanual'sUpgrading
  73. sectionforversion-specificincompatibilities.
  74. Amanualupgradeisrequired.
  75. -Ensurethatyouhaveacomplete,workingbackupofyourdataandmy.cnf
  76. files
  77. -ShutdowntheMySQLservercleanly
  78. -RemovetheexistingMySQLpackages.Usuallythiscommandwill
  79. listthepackagesyoushouldremove:
  80. rpm-qa|grep-i'^mysql-'
  81. Youmaychoosetouse'rpm--nodeps-ev<package-name>'toremove
  82. thepackagewhichcontainsthemysqlclientsharedlibrary.The
  83. librarywillbereinstalledbytheMariaDB-sharedpackage.
  84. -InstallthenewMariaDBpackagessuppliedbyMontyProgramAB
  85. -EnsurethattheMariaDBserverisstarted
  86. -Runthe'mysql_upgrade'program
  87. Thisisabriefdescriptionoftheupgradeprocess.Importantdetails
  88. canbefoundintheMariaDBmanual,intheUpgradingsection.
  89. ******************************************************************
  90. error:%pre(MariaDB-server-5.5.36-1.el6.x86_64)scriptletfailed,exitstatus1
  91. error:install:%prescriptletfailed(2),skippingMariaDB-server-5.5.36-1.el6
  92. Installing:MariaDB-client-5.5.36-1.el6.x86_644/7
  93. Erasing:mysql-5.1.71-1.el6.x86_645/7
  94. Erasing:mysql-libs-5.1.71-1.el6.x86_646/7
  95. Verifying:MariaDB-common-5.5.36-1.el6.x86_641/7
  96. Verifying:MariaDB-compat-5.5.36-1.el6.x86_642/7
  97. Verifying:MariaDB-client-5.5.36-1.el6.x86_643/7
  98. Verifying:mysql-libs-5.1.71-1.el6.x86_644/7
  99. Verifying:MariaDB-server-5.5.36-1.el6.x86_645/7
  100. mysql-server-5.1.71-1.el6.x86_64wassupposedtoberemovedbutisnot!
  101. Verifying:mysql-server-5.1.71-1.el6.x86_646/7
  102. Verifying:mysql-5.1.71-1.el6.x86_647/7
  103. Installed:
  104. MariaDB-client.x86_640:5.5.36-1.el6MariaDB-compat.x86_640:5.5.36-1.el6
  105. DependencyInstalled:
  106. MariaDB-common.x86_640:5.5.36-1.el6
  107. Replaced:
  108. mysql.x86_640:5.1.71-1.el6mysql-libs.x86_640:5.1.71-1.el6
  109. Failed:
  110. MariaDB-server.x86_640:5.5.36-1.el6mysql-server.x86_640:5.1.71-1.el6
  111. Complete!

3、启动MariaDB

[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #/etc/init.d/mysqldstart
  2. InitializingMySQLdatabase:WARNING:Thehost'Cloud-Q2'couldnotbelookedupwithresolveip.
  3. Thisprobablymeansthatyourlibclibrariesarenot100%compatible
  4. withthisbinaryMySQLversion.TheMySQLdaemon,mysqld,shouldwork
  5. normallywiththeexceptionthathostnameresolvingwillnotwork.
  6. ThismeansthatyoushoulduseIPaddressesinsteadofhostnames
  7. whenspecifyingMySQLprivileges!
  8. InstallingMySQLsystemtables...
  9. OK
  10. Fillinghelptables...
  11. OK
  12. Tostartmysqldatboottimeyouhavetocopy
  13. support-files/mysql.servertotherightplaceforyoursystem
  14. PLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!
  15. Todoso,starttheserver,thenissuethefollowingcommands:
  16. /usr/bin/mysqladmin-urootpassword'new-password'
  17. /usr/bin/mysqladmin-uroot-hCloud-Q2password'new-password'
  18. Alternativelyyoucanrun:
  19. /usr/bin/mysql_secure_installation
  20. whichwillalsogiveyoutheoptionofremovingthetest
  21. databasesandanonymoususercreatedbydefault.Thisis
  22. stronglyrecommendedforproductionservers.
  23. Seethemanualformoreinstructions.
  24. YoucanstarttheMySQLdaemonwith:
  25. cd/usr;/usr/bin/mysqld_safe&
  26. YoucantesttheMySQLdaemonwithmysql-test-run.pl
  27. cd/usr/mysql-test;perlmysql-test-run.pl
  28. Pleasereportanyproblemswiththe/usr/bin/mysqlbugscript!
  29. [OK]
  30. Startingmysqld:[OK]

4、为MariaDB设置密码

[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #/usr/bin/mysqladmin-urootpassword'adminadmin'

登陆MariaDB
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. MySQL[(none)]>usemysql;
  2. MySQL[mysql]>updateusersethost='%'whereuser='root'andhost='127.0.0.1';
  3. MySQL[mysql]>grantallprivilegeson*.*to'root'@'%'identifiedby'adminadmin'withgrantoption;
  4. MySQL[mysql]>flushprivileges;

5、让防火墙通过3306端口
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #vi/etc/sysconfig/iptables

添加如下内容:
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. -AINPUT-mstate--stateNEW-mtcp-ptcp--dport3306-jACCEPT

保存并退出编辑
重启防火墙服务
[plain]view plaincopy在CODE上查看代码片派生到我的代码片
  1. #serviceiptablesrestart

远程连接检查,一切OK!
转自作者:chszs,博客主页:http://blog.csdn.net/chszs

www.bkjia.comtruehttp://www.bkjia.com/Linux/1000670.htmlTechArticleCentOS 6.5上安装MariaDB 1、软件环境: CentOS 6.5 x64 MariaDB 5.5.36 2、安装过程 1)在/etc/yum.repos.d/目录创建MariaDB.repo文件,内容如下: [plain]view p...

相关文章

帮客评论

视觉看点