centos6.9 centos7.3 正确安装mariadb的姿势

前端之家收集整理的这篇文章主要介绍了centos6.9 centos7.3 正确安装mariadb的姿势前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

随着MysqL被oracle公司收购之后,越来越多的公司都把自己的数据库转移到了mariadb数据库上面,其实MysqL数据库和mariadb数据库的区别只是换个名字而已,内在的东西一模一样,下面我们就来说一下在centos6和centos7上如何正确的安装mariadb吧


centos7上:

centos7上的yum源里是自带mariadb数据库的,所以我们就给自己的虚拟机装上mariadb的服务器端和客户端,再设置一下密码就可以使用啦。

  1. [root@J-7~]#yum-ygroupinstallmariadbmariadb-client#安装mariadb的服务器端和客户端
  2. Loadedplugins:fastestmirror
  3. Thereisnoinstalledgroupsfile.
  4. Mayberun:yumgroupsmarkconvert(seemanyum)
  5. base|3.6kB00:00:00
  6. elpl|4.3kB00:00:00
  7. Loadingmirrorspeedsfromcachedhostfile
  8. ResolvingDependencies
  9. -->Runningtransactioncheck
  10. ……
  11. Verifying:perl-IO-Compress-2.061-2.el7.noarch14/14
  12.  
  13. Installed:
  14. MysqL-python.x86_640:1.2.5-1.el7mariadb.x86_641:5.5.52-1.el7
  15. mariadb-server.x86_641:5.5.52-1.el7MysqL-connector-odbc.x86_640:5.2.5-6.el7
  16.  
  17. DependencyInstalled:
  18. libtool-ltdl.x86_640:2.4.2-21.el7_2perl-Compress-Raw-Bzip2.x86_640:2.061-3.el7
  19. perl-Compress-Raw-Zlib.x86_641:2.061-4.el7perl-DBD-MysqL.x86_640:4.023-5.el7
  20. perl-DBI.x86_640:1.627-4.el7perl-Data-Dumper.x86_640:2.145-3.el7
  21. perl-IO-Compress.noarch0:2.061-2.el7perl-Net-Daemon.noarch0:0.48-5.el7
  22. perl-PlRPC.noarch0:0.2020-14.el7unixODBC.x86_640:2.3.1-11.el7
  23.  
  24. Complete!
  25. [root@J-7~]#systemctlstartmariadb.service#开启服务
  26. [root@J-7~]#systemctlenablemariadb.service#设置为开机启动
  27. Createdsymlinkfrom/etc/systemd/system/multi-user.target.wants/mariadb.serviceto/usr/lib/systemd/system/mariadb.service.
  28. [root@J-7~]#ss-nutl#查看一下Mariadb的3306端口开启了没有
  29. NetidStateRecv-QSend-QLocalAddress:PortPeerAddress:Port
  30. udpUNCONN00*:12518*:*
  31. udpUNCONN00*:29118*:*
  32. udpUNCONN00*:68*:*
  33. udpUNCONN00*:68*:*
  34. udpUNCONN00:::12518:::*
  35. udpUNCONN00:::24061:::*
  36. tcpLISTEN050*:3306*:*
  37. tcpLISTEN0128*:22*:*
  38. tcpLISTEN0100127.0.0.1:25*:*
  39. tcpLISTEN0128:::22:::*
  40. tcpLISTEN0100::1:25:::*
  41. [root@J-7~]#MysqL_secure_installation#用它自带的这个命令设置一些最基础的东西
  42.  
  43. NOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMariaDB
  44. SERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY!
  45.  
  46. InordertologintoMariaDBtosecureit,we'llneedthecurrent
  47. passwordfortherootuser.Ifyou'vejustinstalledMariaDB,and
  48. youhaven'tsettherootpasswordyet,thepasswordwillbeblank,soyoushouldjustpressenterhere.
  49.  
  50. Entercurrentpasswordforroot(enterfornone):#没有密码要创建,按回车即可
  51. ERROR1045(28000):Accessdeniedforuser'root'@'localhost'(usingpassword:YES)
  52. Entercurrentpasswordforroot(enterfornone):
  53. ERROR1045(28000):Accessdeniedforuser'root'@'localhost'(usingpassword:YES)
  54. Entercurrentpasswordforroot(enterfornone):
  55. OK,successfullyusedpassword,movingon...
  56.  
  57. SettingtherootpasswordensuresthatnobodycanlogintotheMariaDB
  58. rootuserwithouttheproperauthorisation.
  59.  
  60. Setrootpassword?[Y/n]y#是否设置密码
  61. Newpassword:#输入密码
  62. Re-enternewpassword:#确认密码
  63. Passwordupdatedsuccessfully!
  64. Reloadingprivilegetables..
  65. ...Success!
  66.  
  67.  
  68. Bydefault,aMariaDBinstallationhasananonymoususer,allowinganyone
  69. tologintoMariaDBwithouthavingtohaveauseraccountcreatedfor
  70. them.Thisisintendedonlyfortesting,andtomaketheinstallation
  71. goabitsmoother.Youshouldremovethembeforemovingintoa
  72. productionenvironment.
  73.  
  74. Removeanonymoususers?[Y/n]y#移除匿名登录
  75. ...Success!
  76.  
  77. Normally,rootshouldonlybeallowedtoconnectfrom'localhost'.This
  78. ensuresthatsomeonecannotguessattherootpasswordfromthenetwork.
  79.  
  80. Disallowrootloginremotely?[Y/n]no#关闭远程登录
  81. ...Success!
  82.  
  83. Bydefault,MariaDBcomeswithadatabasenamed'test'thatanyonecan
  84. access.Thisisalsointendedonlyfortesting,andshouldberemoved
  85. beforemovingintoaproductionenvironment.
  86.  
  87. Removetestdatabaseandaccesstoit?[Y/n]y#移除测试数据?
  88. -Droppingtestdatabase...
  89. ...Success!
  90. -Removingprivilegesontestdatabase...
  91. ...Success!
  92.  
  93. Reloadingtheprivilegetableswillensurethatallchangesmadesofar
  94. willtakeeffectimmediately.
  95.  
  96. Reloadprivilegetablesnow?[Y/n]y#确定你的配置?
  97. ...Success!
  98.  
  99. Cleaningup...
  100.  
  101. Alldone!Ifyou'vecompletedalloftheabovesteps,yourMariaDB
  102. installationshouldnowbesecure.
  103.  
  104. ThanksforusingMariaDB!
  105. [root@J-7~]#MysqL-uroot-p#登录
  106. Enterpassword:#输入密码
  107. WelcometotheMariaDBmonitor.Commandsendwith;or\g.
  108. YourMariaDBconnectionidis12
  109. Serverversion:5.5.52-MariaDBMariaDBServer
  110.  
  111. Copyright(c)2000,2016,Oracle,MariaDBCorporationAbandothers.
  112.  
  113. Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
  114.  
  115. MariaDB[(none)]>#正常使用

centos6:

centos6上默认的数据库MysqL5.5的,这里我们要安装mariadb10.0的就得自己去Mariadb数据库的官方网站http://mariadb.org 下一个,来进行安装,如果你已经安装了自己卸载干净就行,我这里环境是最小安装的,这里我以二进制编译安装为例:

  1. [root@localhost~]#rz#把自己下载的包传上来
  2.  
  3. [root@localhost~]#ls
  4. anaconda-ks.cfginstall.loginstall.log.syslogmariadb-5.5.57-linux-x86_64.tar.gz
  5. [root@localhost~]#getentpasswdMysqL#检查系统是否已经有了MysqL用户的信息
  6. [root@localhost~]#useradd-r-d/app/data-s/sbin/nologin-u36MysqL#创建MysqL用户,指定家目录和默认shell
  7. [root@localhost~]#idMysqL#查看一下用户信息
  8. uid=36(MysqL)gid=36(MysqL)groups=36(MysqL)
  9. [root@localhost~]#ll/app/data-d#看一下我们计划存放数据库的目录信息
  10. drwxr-xr-x2rootroot4096Jul2800:34/app/data
  11. [root@localhost~]#chownMysqL:MysqL/app/data/#修改目录的属组和属主
  12. [root@localhost~]#tarxfmariadb-5.5.57-linux-x86_64.tar.gz-C/usr/local/#将二进制包解压放到指定位置
  13. [root@localhost~]#cd/usr/local/
  14. [root@localhostlocal]#ll
  15. total44
  16. drwxr-xr-x.2rootroot4096Sep232011bin
  17. drwxr-xr-x.2rootroot4096Sep232011etc
  18. drwxr-xr-x.2rootroot4096Sep232011games
  19. drwxr-xr-x.2rootroot4096Sep232011include
  20. drwxr-xr-x.2rootroot4096Sep232011lib
  21. drwxr-xr-x.2rootroot4096Sep232011lib64
  22. drwxr-xr-x.2rootroot4096Sep232011libexec
  23. drwxr-xr-x12rootroot4096Jul2800:38mariadb-5.5.57-linux-x86_64
  24. drwxr-xr-x.2rootroot4096Sep232011sbin
  25. drwxr-xr-x.5rootroot4096Jul2720:51share
  26. drwxr-xr-x.2rootroot4096Sep232011src
  27. [root@localhostlocal]#ln-smariadb-5.5.57-linux-x86_64/MysqL/#给mariadb写一个软连接,切记不要后面的/
  28. ln:target`MysqL/'isnotadirectory:Nosuchfileordirectory
  29. [root@localhostlocal]#ln-smariadb-5.5.57-linux-x86_64/MysqL
  30. [root@localhostlocal]#ll#查看一下
  31. total44
  32. drwxr-xr-x.2rootroot4096Sep232011bin
  33. drwxr-xr-x.2rootroot4096Sep232011etc
  34. drwxr-xr-x.2rootroot4096Sep232011games
  35. drwxr-xr-x.2rootroot4096Sep232011include
  36. drwxr-xr-x.2rootroot4096Sep232011lib
  37. drwxr-xr-x.2rootroot4096Sep232011lib64
  38. drwxr-xr-x.2rootroot4096Sep232011libexec
  39. drwxr-xr-x12rootroot4096Jul2800:38mariadb-5.5.57-linux-x86_64
  40. lrwxrwxrwx1rootroot28Jul2800:39MysqL->mariadb-5.5.57-linux-x86_64/
  41. drwxr-xr-x.2rootroot4096Sep232011sbin
  42. drwxr-xr-x.5rootroot4096Jul2720:51share
  43. drwxr-xr-x.2rootroot4096Sep232011src
  44. [root@localhostlocal]#llMysqL/#看一下MysqL文件夹的属组和属主
  45. total192
  46. drwxr-xr-x2rootroot4096Jul2800:38bin
  47. -rw-r--r--1wangwang17987Jul1904:33COPYING
  48. drwxr-xr-x3rootroot4096Jul2800:38data
  49. -rw-r--r--1wangwang8245Jul1904:33EXCEPTIONS-CLIENT
  50. drwxr-xr-x3rootroot4096Jul2800:38include
  51. -rw-r--r--1wangwang8694Jul1904:33INSTALL-BINARY
  52. drwxr-xr-x3rootroot4096Jul2800:38lib
  53. drwxr-xr-x4rootroot4096Jul2800:38man
  54. drwxr-xr-x11rootroot4096Jul2800:37MysqL-test
  55. -rw-r--r--1wangwang108813Jul1904:33README
  56. drwxr-xr-x2rootroot4096Jul2800:38scripts
  57. drwxr-xr-x27rootroot4096Jul2800:38share
  58. drwxr-xr-x4rootroot4096Jul2800:38sql-bench
  59. drwxr-xr-x3rootroot4096Jul2800:38support-files
  60. [root@localhostlocal]#chgrp-RMysqLMysqL/#修改MysqL的属组
  61. [root@localhostlocal]#llMysqL/
  62. total192
  63. drwxr-xr-x2rootMysqL4096Jul2800:38bin
  64. -rw-r--r--1wangMysqL17987Jul1904:33COPYING
  65. drwxr-xr-x3rootMysqL4096Jul2800:38data
  66. -rw-r--r--1wangMysqL8245Jul1904:33EXCEPTIONS-CLIENT
  67. drwxr-xr-x3rootMysqL4096Jul2800:38include
  68. -rw-r--r--1wangMysqL8694Jul1904:33INSTALL-BINARY
  69. drwxr-xr-x3rootMysqL4096Jul2800:38lib
  70. drwxr-xr-x4rootMysqL4096Jul2800:38man
  71. drwxr-xr-x11rootMysqL4096Jul2800:37MysqL-test
  72. -rw-r--r--1wangMysqL108813Jul1904:33README
  73. drwxr-xr-x2rootMysqL4096Jul2800:38scripts
  74. drwxr-xr-x27rootMysqL4096Jul2800:38share
  75. drwxr-xr-x4rootMysqL4096Jul2800:38sql-bench
  76. drwxr-xr-x3rootMysqL4096Jul2800:38support-files
  77. [root@localhostlocal]#ll/etc/my.cnf#这个是系统自带配置文件
  78. -rw-r--r--.1rootroot251Jan2706:25/etc/my.cnf
  79. [root@localhostlocal]#rpm-qf/etc/my.cnf#这个配置文件来自MysqL的包
  80. MysqL-libs-5.1.73-8.el6_8.x86_64
  81. [root@localhostlocal]#cat/etc/my.cnf#看一下这个配置的内容
  82. [MysqLd]
  83. datadir=/var/lib/MysqL
  84. socket=/var/lib/MysqL/MysqL.sock
  85. user=MysqL
  86. #Disablingsymbolic-linksisrecommendedtopreventassortedsecurityrisks
  87. symbolic-links=0
  88.  
  89. [MysqLd_safe]
  90. log-error=/var/log/MysqLd.log
  91. pid-file=/var/run/MysqLd/MysqLd.pid
  92. [root@localhostlocal]#cdMysqL#进入到MysqL文件
  93. [root@localhostMysqL]#ls
  94. bindataincludelibMysqL-testscriptssql-bench
  95. COPYINGEXCEPTIONS-CLIENTINSTALL-BINARYmanREADMEsharesupport-files
  96. [root@localhostMysqL]#cdsupport-files/#查看一下support-files文件夹,里面全部都是模板文件
  97. [root@localhostsupport-files]#ls
  98. binary-configuremy-innodb-heavy-4G.cnfmy-small.cnfMysqL.server
  99. magicmy-large.cnfMysqLd_multi.serverSELinux
  100. my-huge.cnfmy-medium.cnfMysqL-log-rotate
  101. [root@localhostsupport-files]#mkdir/etc/MysqL#创建一个存放我们自己配置的文件
  102. [root@localhostsupport-files]#cpmy-huge.cnf/etc/MysqL/my.cnf#复制一个模板配置修改成适合自己用的
  103. [root@localhostsupport-files]#vim/etc/MysqL/my.cnf
  104. ……
  105. [MysqLd]
  106. datadir=/app/data#存放目录
  107. innodb_file_per_table=on#使用引擎(可不写)
  108. skip_name_resolve=on#禁止解析(可不写)
  109. port=3306
  110. socket=/tmp/MysqL.sock
  111. skip-external-locking
  112. key_buffer_size=384M
  113. max_allowed_packet=1M
  114. table_open_cache=512
  115. sort_buffer_size=2M
  116. read_buffer_size=2M
  117. ……
  118. [root@localhostsupport-files]#cd/usr/local/MysqL/#进入到MysqL文件
  119. [root@localhostMysqL]#scripts/MysqL_install_db--user=MysqL--datadir=/app/data/#执行包带的脚本并指定存放地址和执行用户
  120. InstallingMariaDB/MysqLsystemtablesin'/app/data/'...#一些关键说明
  121. 1707284:33:26[Warning]'THREAD_CONCURRENCY'isdeprecatedandwillberemovedinafuturerelease.
  122. 1707284:33:26[Note]./bin/MysqLd(MysqLd5.5.57-MariaDB)startingasprocess1872...
  123. OK
  124. Fillinghelptables...
  125. 1707284:33:27[Warning]'THREAD_CONCURRENCY'isdeprecatedandwillberemovedinafuturerelease.
  126. 1707284:33:27[Note]./bin/MysqLd(MysqLd5.5.57-MariaDB)startingasprocess1881...
  127. OK
  128.  
  129. TostartMysqLdatboottimeyouhavetocopy
  130. support-files/MysqL.servertotherightplaceforyoursystem
  131.  
  132. PLEASEREMEMBERTOSETAPASSWORDFORTHEMariaDBrootUSER!
  133. Todoso,starttheserver,thenissuethefollowingcommands:
  134.  
  135. './bin/MysqLadmin'-urootpassword'new-password'
  136. './bin/MysqLadmin'-uroot-hlocalhost.localdomainpassword'new-password'
  137.  
  138. Alternativelyyoucanrun:
  139. './bin/MysqL_secure_installation'
  140.  
  141. whichwillalsogiveyoutheoptionofremovingthetest
  142. databasesandanonymoususercreatedbydefault.Thisis
  143. stronglyrecommendedforproductionservers.
  144.  
  145. SeetheMariaDBKnowledgebaseathttp://mariadb.com/kborthe
  146. MysqLmanualformoreinstructions.
  147.  
  148. YoucanstarttheMariaDBdaemonwith:
  149. cd'.';./bin/MysqLd_safe--datadir='/app/data/'
  150.  
  151. YoucantesttheMariaDBdaemonwithMysqL-test-run.pl
  152. cd'./MysqL-test';perlMysqL-test-run.pl
  153. …………
  154.  
  155. https://mariadb.org/get-involved/
  156.  
  157. [root@localhostMysqL]#ls/app/data/#查看一下我们存放数据库文件
  158. aria_log.00000001MysqLMysqL-bin.000002performance_schema
  159. aria_log_controlMysqL-bin.000001MysqL-bin.indextest
  160. [root@localhostMysqL]#cdsupport-files/
  161. [root@localhostMysqL]#pwd
  162. /usr/local/MysqL
  163. [root@localhostMysqL]#ll/app/data/
  164. total1084
  165. -rw-rw----1MysqLMysqL16384Jul2804:33aria_log.00000001
  166. -rw-rw----1MysqLMysqL52Jul2804:33aria_log_control
  167. drwx------2MysqLroot4096Jul2804:33MysqL
  168. -rw-rw----1MysqLMysqL30379Jul2804:33MysqL-bin.000001
  169. -rw-rw----1MysqLMysqL1038814Jul2804:33MysqL-bin.000002
  170. -rw-rw----1MysqLMysqL38Jul2804:33MysqL-bin.index
  171. drwx------2MysqLMysqL4096Jul2804:33performance_schema
  172. drwx------2MysqLroot4096Jul2804:33test
  173. [root@localhostMysqL]#ls
  174. bindataincludelibMysqL-testscriptssql-bench
  175. COPYINGEXCEPTIONS-CLIENTINSTALL-BINARYmanREADMEsharesupport-files
  176. [root@localhostMysqL]#cpsupport-files/MysqL.server/etc/init.d/MysqLd#复制一个启动服务脚本
  177. [root@localhostMysqL]#chkconfig--listMysqLd#查看服务
  178. serviceMysqLdsupportschkconfig,butisnotreferencedinanyrunlevel(run'chkconfig--addMysqLd')
  179. [root@localhostMysqL]#chkconfig--addMysqLd#把MysqLd服务加进去
  180. [root@localhostMysqL]#chkconfigMysqLdon#开机自启
  181. [root@localhostMysqL]#chkconfig--listMysqLd#看一下服务
  182. MysqLd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
  183. [root@localhostMysqL]#serviceMysqLdstart#启动服务
  184. StartingMysqL.17072804:40:26MysqLd_safeLoggingto'/var/log/MysqLd.log'.#因没有日志文件夹报错
  185. 17072804:40:26MysqLd_safeStartingMysqLddaemonwithdatabasesfrom/app/data
  186. /usr/local/MysqL/bin/MysqLd_safe_helper:Can'tcreate/writetofile'/var/log/MysqLd.log'(Errcode:13)
  187. ERROR!
  188. [root@localhostMysqL]#cat/etc/my.cnf#看一下系统自带MysqL配置
  189. [MysqLd]
  190. datadir=/var/lib/MysqL
  191. socket=/var/lib/MysqL/MysqL.sock
  192. user=MysqL
  193. #Disablingsymbolic-linksisrecommendedtopreventassortedsecurityrisks
  194. symbolic-links=0
  195.  
  196. [MysqLd_safe]
  197. log-error=/var/log/MysqLd.log#日志正确存放地址
  198. pid-file=/var/run/MysqLd/MysqLd.pid
  199. [root@localhostMysqL]#touch/var/log/MysqLd.log#创建一个日志文件
  200. [root@localhostMysqL]#chownMysqL/var/log/MysqLd.log#修改属主,给它个写的权限
  201. [root@localhostMysqL]#serverMysqLdstart
  202. -bash:server:commandnotfound
  203. [root@localhostMysqL]#serviceMysqLdstart#启动服务
  204. StartingMysqL.17072804:45:01MysqLd_safeLoggingto'/var/log/MysqLd.log'.
  205. 17072804:45:01MysqLd_safeStartingMysqLddaemonwithdatabasesfrom/app/data
  206. .SUCCESS!
  207. [root@localhostMysqL]#ss-ntl#查看一下端口,3306开启了
  208. StateRecv-QSend-QLocalAddress:PortPeerAddress:Port
  209. LISTEN050*:3306*:*
  210. LISTEN0128:::22:::*
  211. LISTEN0128*:22*:*
  212. LISTEN0100::1:25:::*
  213. LISTEN0100127.0.0.1:25*:*
  214. [root@localhostMysqL]#MysqL#直接登录使用,报错命令没找到
  215. -bash:MysqL:commandnotfound
  216. [root@localhostMysqL]#pwd
  217. /usr/local/MysqL
  218. [root@localhostMysqL]#ls
  219. bindataincludelibMysqL-testscriptssql-bench
  220. COPYINGEXCEPTIONS-CLIENTINSTALL-BINARYmanREADMEsharesupport-files
  221. [root@localhostMysqL]#cdbin/
  222. [root@localhostbin]#vim/etc/profile.d/MysqL.sh#写一个配置文件,把MysqL放到bin下
  223. exportPATH=/usr/local/MysqL/bin:$PATH
  224. [root@localhostbin]#./etc/profile.d/MysqL.sh#执行一下
  225. [root@localhostbin]#MysqL#登录一下,可以匿名登录肯定不行啊,出去设置一下
  226. WelcometotheMariaDBmonitor.Commandsendwith;or\g.
  227. YourMariaDBconnectionidis2
  228. Serverversion:5.5.57-MariaDBMariaDBServer
  229.  
  230. Copyright(c)2000,2017,MariaDBCorporationAbandothers.
  231.  
  232. Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
  233.  
  234. MariaDB[(none)]>exit
  235. Bye
  236. [root@localhostbin]#MysqL_se
  237. MysqL_secure_installationMysqL_setpermission
  238. [root@localhostbin]#MysqL_secure_installation#执行脚本,完成基本的安全设置
  239. /usr/local/MysqL/bin/MysqL_secure_installation:line393:find_MysqL_client:commandnotfound
  240.  
  241. NOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMariaDB
  242. SERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY!
  243.  
  244. InordertologintoMariaDBtosecureit,soyoushouldjustpressenterhere.
  245.  
  246. Entercurrentpasswordforroot(enterfornone):
  247. OK,movingon...
  248.  
  249. SettingtherootpasswordensuresthatnobodycanlogintotheMariaDB
  250. rootuserwithouttheproperauthorisation.
  251.  
  252. Setrootpassword?[Y/n]y#设置密码?
  253.  
  254. Newpassword:#第一次输入密码
  255. Re-enternewpassword:#确认密码
  256. Passwordupdatedsuccessfully!
  257. Reloadingprivilegetables..
  258. ...Success!
  259.  
  260.  
  261. Bydefault,andtomaketheinstallation
  262. goabitsmoother.Youshouldremovethembeforemovingintoa
  263. productionenvironment.
  264.  
  265. Removeanonymoususers?[Y/n]y#禁止匿名用户
  266. ...Success!
  267.  
  268. Normally,rootshouldonlybeallowedtoconnectfrom'localhost'.This
  269. ensuresthatsomeonecannotguessattherootpasswordfromthenetwork.
  270.  
  271. Disallowrootloginremotely?[Y/n]n#禁止root远程登录
  272. ...skipping.
  273.  
  274. Bydefault,andshouldberemoved
  275. beforemovingintoaproductionenvironment.
  276.  
  277. Removetestdatabaseandaccesstoit?[Y/n]y#移除系统的测试数据?
  278. -Droppingtestdatabase...
  279. ...Success!
  280. -Removingprivilegesontestdatabase...
  281. ...Success!
  282.  
  283. Reloadingtheprivilegetableswillensurethatallchangesmadesofar
  284. willtakeeffectimmediately.
  285.  
  286. Reloadprivilegetablesnow?[Y/n]y#确认加载配置?
  287. ...Success!
  288.  
  289. Cleaningup...
  290.  
  291. Alldone!Ifyou'vecompletedalloftheabovesteps,yourMariaDB
  292. installationshouldnowbesecure.
  293.  
  294. ThanksforusingMariaDB!
  295. [root@localhostbin]#MysqL-uroot-p#登录
  296. Enterpassword:#输入密码
  297. WelcometotheMariaDBmonitor.Commandsendwith;or\g.
  298. YourMariaDBconnectionidis10
  299. Serverversion:5.5.57-MariaDBMariaDBServer
  300.  
  301. Copyright(c)2000,MariaDBCorporationAbandothers.
  302.  
  303. Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
  304.  
  305. MariaDB[(none)]>#安装完成

猜你在找的CentOS相关文章