centos7 安装 mariadb 及安装设置

2023-05-16

使用的是linode的centos7系统,安装mysql发现已经默认的是mariadb。

但是不管是使用linode官网说明还是百度搜索到的的根本安装方法无法安装成功。

总是提示这一句:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

 

 

最后通过google 搜索 install mariadb on centos 7得到了安装的关键一步。

现在安装成功,特此备注一下整个安装过程:

 

[php] view plaincopy 在CODE上查看代码片 派生到我的代码片
 
  1. mysql:[root@localhost ~]# yum -y install mariadb*  
  2. Loaded plugins: fastestmirror  
  3. Loading mirror speeds from cached hostfile  
  4.  * base: mirrors.linode.com  
  5.  * extras: mirrors.linode.com  
  6.  * updates: mirrors.linode.com  
  7. Resolving Dependencies  
  8. --> Running transaction check  
  9. ---> Package mariadb.x86_64 1:5.5.37-1.el7_0 will be installed  
  10. ---> Package mariadb-bench.x86_64 1:5.5.37-1.el7_0 will be installed  
  11. ---> Package mariadb-devel.x86_64 1:5.5.37-1.el7_0 will be installed  
  12. ---> Package mariadb-embedded.x86_64 1:5.5.37-1.el7_0 will be installed  
  13. ---> Package mariadb-embedded-devel.x86_64 1:5.5.37-1.el7_0 will be installed  
  14. ---> Package mariadb-libs.x86_64 1:5.5.37-1.el7_0 will be installed  
  15. ---> Package mariadb-server.x86_64 1:5.5.37-1.el7_0 will be installed  
  16. --> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.37-1.el7_0.x86_64  
  17. ---> Package mariadb-test.x86_64 1:5.5.37-1.el7_0 will be installed  
  18. --> Running transaction check  
  19. ---> Package perl-DBD-MySQL.x86_64 0:4.023-5.el7 will be installed  
  20. --> Finished Dependency Resolution  
  21.   
  22. Dependencies Resolved  
  23.   
  24. ==========================================================================================================  
  25.  Package                           Arch              Version                     Repository          Size  
  26. ==========================================================================================================  
  27. Installing:  
  28.  mariadb                           x86_64            1:5.5.37-1.el7_0            updates            8.9 M  
  29.  mariadb-bench                     x86_64            1:5.5.37-1.el7_0            updates            385 k  
  30.  mariadb-devel                     x86_64            1:5.5.37-1.el7_0            updates            744 k  
  31.  mariadb-embedded                  x86_64            1:5.5.37-1.el7_0            updates            3.6 M  
  32.  mariadb-embedded-devel            x86_64            1:5.5.37-1.el7_0            updates            7.4 M  
  33.  mariadb-libs                      x86_64            1:5.5.37-1.el7_0            updates            752 k  
  34.  mariadb-server                    x86_64            1:5.5.37-1.el7_0            updates             11 M  
  35.  mariadb-test                      x86_64            1:5.5.37-1.el7_0            updates            7.9 M  
  36. Installing for dependencies:  
  37.  perl-DBD-MySQL                    x86_64            4.023-5.el7                 base               140 k  
  38.   
  39. Transaction Summary  
  40. ==========================================================================================================  
  41. Install  8 Packages (+1 Dependent package)  
  42.   
  43. Total download size: 40 M  
  44. Installed size: 279 M  
  45. Downloading packages:  
  46. (1/9): mariadb-bench-5.5.37-1.el7_0.x86_64.rpm                                     | 385 kB  00:00:00  
  47. (2/9): mariadb-devel-5.5.37-1.el7_0.x86_64.rpm                                     | 744 kB  00:00:00  
  48. (3/9): mariadb-embedded-5.5.37-1.el7_0.x86_64.rpm                                  | 3.6 MB  00:00:00  
  49. (4/9): mariadb-5.5.37-1.el7_0.x86_64.rpm                                           | 8.9 MB  00:00:00  
  50. (5/9): mariadb-libs-5.5.37-1.el7_0.x86_64.rpm                                      | 752 kB  00:00:00  
  51. (6/9): mariadb-server-5.5.37-1.el7_0.x86_64.rpm                                    |  11 MB  00:00:00  
  52. (7/9): mariadb-embedded-devel-5.5.37-1.el7_0.x86_64.rpm                            | 7.4 MB  00:00:00  
  53. (8/9): mariadb-test-5.5.37-1.el7_0.x86_64.rpm                                      | 7.9 MB  00:00:00  
  54. (9/9): perl-DBD-MySQL-4.023-5.el7.x86_64.rpm                                       | 140 kB  00:00:00  
  55. ----------------------------------------------------------------------------------------------------------  
  56. Total                                                                      36 MB/s |  40 MB  00:00:01  
  57. Running transaction check  
  58. Running transaction test  
  59. Transaction test succeeded  
  60. Running transaction  
  61.   Installing : 1:mariadb-libs-5.5.37-1.el7_0.x86_64                                                   1/9  
  62.   Installing : 1:mariadb-5.5.37-1.el7_0.x86_64                                                        2/9  
  63.   Installing : perl-DBD-MySQL-4.023-5.el7.x86_64                                                      3/9  
  64.   Installing : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                 4/9  
  65.   Installing : 1:mariadb-devel-5.5.37-1.el7_0.x86_64                                                  5/9  
  66.   Installing : 1:mariadb-embedded-5.5.37-1.el7_0.x86_64                                               6/9  
  67.   Installing : 1:mariadb-embedded-devel-5.5.37-1.el7_0.x86_64                                         7/9  
  68.   Installing : 1:mariadb-test-5.5.37-1.el7_0.x86_64                                                   8/9  
  69.   Installing : 1:mariadb-bench-5.5.37-1.el7_0.x86_64                                                  9/9  
  70.   Verifying  : 1:mariadb-test-5.5.37-1.el7_0.x86_64                                                   1/9  
  71.   Verifying  : 1:mariadb-embedded-devel-5.5.37-1.el7_0.x86_64                                         2/9  
  72.   Verifying  : 1:mariadb-embedded-5.5.37-1.el7_0.x86_64                                               3/9  
  73.   Verifying  : 1:mariadb-libs-5.5.37-1.el7_0.x86_64                                                   4/9  
  74.   Verifying  : 1:mariadb-bench-5.5.37-1.el7_0.x86_64                                                  5/9  
  75.   Verifying  : 1:mariadb-5.5.37-1.el7_0.x86_64                                                        6/9  
  76.   Verifying  : 1:mariadb-server-5.5.37-1.el7_0.x86_64                                                 7/9  
  77.   Verifying  : perl-DBD-MySQL-4.023-5.el7.x86_64                                                      8/9  
  78.   Verifying  : 1:mariadb-devel-5.5.37-1.el7_0.x86_64                                                  9/9  
  79.   
  80. Installed:  
  81.   mariadb.x86_64 1:5.5.37-1.el7_0                        mariadb-bench.x86_64 1:5.5.37-1.el7_0  
  82.   mariadb-devel.x86_64 1:5.5.37-1.el7_0                  mariadb-embedded.x86_64 1:5.5.37-1.el7_0  
  83.   mariadb-embedded-devel.x86_64 1:5.5.37-1.el7_0         mariadb-libs.x86_64 1:5.5.37-1.el7_0  
  84.   mariadb-server.x86_64 1:5.5.37-1.el7_0                 mariadb-test.x86_64 1:5.5.37-1.el7_0  
  85.   
  86. Dependency Installed:  
  87.   perl-DBD-MySQL.x86_64 0:4.023-5.el7  
  88.   
  89. Complete!  
  90. [root@localhost ~]# systemctl start mariadb.service  
  91. [root@localhost ~]# systemctl enable mariadb.service  
  92. ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.servi                       
  93. ce'  
  94. [root@localhost ~]# mysql  
  95. Welcome to the MariaDB monitor.  Commands end with ; or \g.  
  96. Your MariaDB connection id is 2  
  97. Server version: 5.5.37-MariaDB MariaDB Server  
  98.   
  99. Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.  
  100.   
  101. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  102.   
  103. MariaDB [(none)]> logout  
  104.     -> exit  
  105.     ->  
  106.     -> ;  
  107. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaD                       
  108. B server version for the right syntax to use near 'logout  
  109. exit' at line 1  
  110. MariaDB [(none)]> exit  
  111. Bye  
  112. [root@localhost ~]# systemctl enable mariadb.service  
  113. [root@localhost ~]# mysql  
  114. Welcome to the MariaDB monitor.  Commands end with ; or \g.  
  115. Your MariaDB connection id is 3  
  116. Server version: 5.5.37-MariaDB MariaDB Server  
  117.   
  118. Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.  
  119.   
  120. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  121.   
  122. MariaDB [(none)]> show databases;  
  123. +--------------------+  
  124. | Database           |  
  125. +--------------------+  
  126. | information_schema |  
  127. | mysql              |  
  128. | performance_schema |  
  129. | test               |  
  130. +--------------------+  
  131. 4 rows in set (0.00 sec)  
  132.   
  133. MariaDB [(none)]> use test  
  134. Database changed  
  135. MariaDB [test]> show tables;  
  136. Empty set (0.00 sec)  
  137.   
  138. MariaDB [test]> exit  
  139. Bye  
  140. [root@localhost ~]# mysql_secure_installation  
  141. /usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found  
  142.   
  143. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB  
  144.       SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!  
  145.   
  146. In order to log into MariaDB to secure it, we'll need the current  
  147. password for the root user.  If you've just installed MariaDB, and  
  148. you haven't set the root password yet, the password will be blank,  
  149. so you should just press enter here.  
  150.   
  151. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)  
  152. Enter current password for root (enter for none):  
  153. OK, successfully used password, moving on...  
  154.   
  155. Setting the root password ensures that nobody can log into the MariaDB  
  156. root user without the proper authorisation.  
  157.   
  158. Set root password? [Y/n] y  
  159. New password:  
  160. Re-enter new password:  
  161. Password updated successfully!  
  162. Reloading privilege tables..  
  163.  ... Success!  
  164.   
  165.   
  166. By default, a MariaDB installation has an anonymous user, allowing anyone  
  167. to log into MariaDB without having to have a user account created for  
  168. them.  This is intended only for testing, and to make the installation  
  169. go a bit smoother.  You should remove them before moving into a  
  170. production environment.  
  171.   
  172. Remove anonymous users? [Y/n] y  
  173.  ... Success!  
  174.   
  175. Normally, root should only be allowed to connect from 'localhost'.  This  
  176. ensures that someone cannot guess at the root password from the network.  
  177.   
  178. Disallow root login remotely? [Y/n] y  
  179.  ... Success!  
  180.   
  181. By default, MariaDB comes with a database named 'test' that anyone can  
  182. access.  This is also intended only for testing, and should be removed  
  183. before moving into a production environment.  
  184.   
  185. Remove test database and access to it? [Y/n] y  
  186.  - Dropping test database...  
  187.  ... Success!  
  188.  - Removing privileges on test database...  
  189.  ... Success!  
  190.   
  191. Reloading the privilege tables will ensure that all changes made so far  
  192. will take effect immediately.  
  193.   
  194. Reload privilege tables now? [Y/n] y  
  195.  ... Success!  
  196.   
  197. Cleaning up...  
  198.   
  199. All done!  If you've completed all of the above steps, your MariaDB  
  200. installation should now be secure.  
  201.   
  202. Thanks for using MariaDB!  
  203. [root@localhost ~]# mysql -uroot -p  
  204. Enter password:  
  205. Welcome to the MariaDB monitor.  Commands end with ; or \g.  
  206. Your MariaDB connection id is 15  
  207. Server version: 5.5.37-MariaDB MariaDB Server  
  208.   
  209. Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.  
  210.   
  211. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  212.   
  213. MariaDB [(none)]> show databases;  
  214. +--------------------+  
  215. | Database           |  
  216. +--------------------+  
  217. | information_schema |  
  218. | mysql              |  
  219. | performance_schema |  
  220. | zbphp.com          |  
  221. +--------------------+  
  222. 4 rows in set (0.00 sec)  
  223.   
  224. MariaDB [(none)]>  
  225.   
  226. 原文连接:http://www.centoscn.com/image-text/install/2014/0909/3704.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

centos7 安装 mariadb 及安装设置 的相关文章

随机推荐

  • C++初阶:vector类

    vector 0 vector的介绍 vector是用数组实现的 可变长度的顺序容器 xff0c 本质是一种类模板 span class token keyword template span span class token operat
  • Git之分支创建策略

    分支类型 git上始终保持两个分支 xff0c master分支 develop分支 master分支主要用于发布时使用 xff0c 而develop分支主要用于开发使用 除了以上两个常驻分支外 xff0c 我们还可以适当分支出三种分支 x
  • ubuntu 设置pip源

    前言 在Ubuntu下我们一般使用pip工具去管理我们的Python包 但是在使用pip命令操作的时候一般都是使用的默认设置 xff0c 使用的是国外的镜像 xff0c 这就导致了我们在国内下载安装包的时候很慢 xff08 乌龟慢慢爬 xf
  • 27.串口通信实验源码讲解

    串口通信实验源码讲解 笔记基于正点原子官方视频 视频连接https www bilibili com video BV1Wx411d7wT p 61 71 amp spm id from 61 333 1007 top right bar
  • 国内快速下载keil的pack文件包

    问题 xff1a 国内keil官网下载pack文件包太慢 xff0c 网上很多网盘资源如果没有VIP也是很慢 解决方案 xff1a https www keil com dd2 pack 第一步 xff1a 首先去上面的keil官网找自己需
  • forensics - make virtual machine with E01[ewf] files on OSX ———— 电子取证 MAC OS平台仿真

    forensics make virtual machine with E01 ewf files on OSX 电子取证 MAC OS平台仿真1挂载库安装osxfuselibewf 2 虚拟机存储文件qemu 3 开始实验 amp amp
  • 如何从官网下载 Google Chrome 离线安装包

    Google Chrome 已经是许多人的默认浏览器 xff0c 但由于 你懂的 原因 xff0c 在线安装基本没有成功过 xff0c 他自己的自动更新也多数一直在加载中 xff0c 所以我们会到一些下载站下载安装包 xff0c 但我的多次
  • 腾讯资深3D游戏建模师你不知道的5个3DMAX细节

    首先我们要清楚的是行业划分 3DMAX的用途非常广泛 xff0c 所涉及的行业大致有 xff0c 园林景观 城市规划 建筑设计 室内设计 动漫设计 商业动画制作等 所以我们在入手学3DMAX软件时 xff0c 大家应该分清楚 xff0c 你
  • 通过GetProcessNameByProcessId得到进程路径

    写主防时 xff0c 为了拿到进程路径 xff0c 所以查询发现一种发现一种方式是通过PID xff0c 调用PsLookupProcessByProcessId ProcessId amp ProcessObj 拿到进程的EPROCESS
  • 10.Python修炼之路【14-链表】2018.05.11

    关键字 xff1a 单链表 双链表 循环单链表 循环双链表 一 链表 1 为什么需要链表 顺序表的构建需要预先知道数据大小来申请连续的存储空间 xff0c 而在进行扩充时又需要进行数据的搬迁 xff0c 所以使用起来并不是很灵活 链表结构可
  • 谈谈Linux内核的实时性优化

    1 实时系统的概念 1 1什么是实时操作系统 什么是实时操作系统 xff1f 接触过嵌入式的小伙伴可能会知道 xff0c 实时操作系统是指在嵌入式领域广泛应用的各类RTOS Real Time Operating System 其中最具代表
  • docker 命令详解(十八):port

    一 命令作用 列出指定的容器的端口映射 xff0c 或者查找将 PRIVATE PORT NAT 到面向公众的端口 二 命令语法 docker port OPTIONS CONTAINER PRIVATE PORT PROTO 三 使用示例
  • 在Ubuntu 20.04上面搭建嵌入式开发环境

    电脑系统盘出故障了 xff0c 重新安装了Ubunt20 04 xff08 之前用的是18 04 日常工作编译基于Rockchip和AM335x系列芯片的内核和U boot比较多 xff0c 所以先搭建它们的开发环境 包括并不限依赖的库和常
  • 自下而上和自上而下的注意力:不同的过程和重叠的神经系统 2014sci

    摘要 大脑在处理物理世界中任何时刻出现的所有感官刺激的能力是有限的 xff0c 相反 xff0c 它依赖于根据瞬间的偶然性集中神经资源的注意力的认知过程 注意可以分为两种不同的功能 自下而上的注意 xff0c 指的是单纯 由外部 驱动因素对
  • Python爬虫抓取基金数据

    Python做网络爬虫需要学习额外基本知识 xff1a 1 HTML 基金所需的数据都通过HTML网页的形式返回 xff0c 数据和HTML tag通过一定的规范组成渲染后的形成网页 了解HTML是为了有效地剥离数据 2 Python的正则
  • ASN1.c v2x开发记录

    一 工具安装及使用 Asn1c编解码器代码git xff1a https github com vlm asn1c 当前主线版本为0 9 29 发布最新版本为0 9 28 将文件解压后 xff0c 依次执行 xff08 1 xff09 te
  • 高德地图api开发记录

    1 高德地图api使用讲解 https blog csdn net Augenstern QXL article details 120488096 具体的使用可以参考高德官方提供的demo和参考手册 2 地图坐标问题 高德地图使用的地图坐
  • vsphere远程访问ESXI端口

    如果要让VM ESXI在外网供用户访问的话 xff0c 要在路由器上面设置两个端口443 902 其中443 端口 主要 负责 别名 讯息 的 传递 xff0c 而 902 端口 主要 负责 远端 控制台 画面 的 传递 vsphere版本
  • CentOS7 下源码安装MPlayer播放器

    最近学习了build源码安装软件 xff0c 老师布置的习题 xff0c 用所学过的知识安装mplayer播放器 通过上网我了解到在linux系统下 xff0c mplayer播放器十分强大好用 但是 xff0c 在安装的过程中遇到了很多问
  • centos7 安装 mariadb 及安装设置

    使用的是linode的centos7系统 xff0c 安装mysql发现已经默认的是mariadb 但是不管是使用linode官网说明还是百度搜索到的的根本安装方法无法安装成功 总是提示这一句 xff1a ERROR 2002 HY000