星空网 > 软件开发 > 操作系统

centos通过yum安装mariadb(mysql)无法启动服务或者找不到mysql.sock

  今天在某云主机(centos7)安装(yum install方式)mariadb(即开源mysql)后,无法启动mariadb,其实是安装不完整,当然启动不了,更不用说输入"mysql -u root"提示Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)了 。没什么技术含量的解决方法开始了。

  安装mariadb,先搜索一发:

$ sudo yum search mariadb

出现:

$ sudo yum search mariadbLoaded plugins: langpacks============================= N/S matched: mariadb =============================mariadb-bench.x86_64 : MariaDB benchmark scripts and datamariadb-devel.i686 : Files for development of MariaDB/MySQL applicationsmariadb-devel.x86_64 : Files for development of MariaDB/MySQL applicationsmariadb-embedded.i686 : MariaDB as an embeddable librarymariadb-embedded.x86_64 : MariaDB as an embeddable librarymariadb-embedded-devel.i686 : Development files for MariaDB as an embeddable : librarymariadb-embedded-devel.x86_64 : Development files for MariaDB as an embeddable : librarymariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clientsmariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clientsmariadb-server.x86_64 : The MariaDB server and related filesmariadb.x86_64 : A community developed branch of MySQLmariadb-test.x86_64 : The test suite distributed with MariaD

嗯,把 mariadb mariadb-bench mariadb-server mariadb-embdedeb mariadb-libs mariadb-server都安装:

$ yum install mariadb-embedded mariadb-libs mariadb-bench mariadb mariadb-sever

启动mariadb,再试试"mysql -u root“发现可以了,好吧,作为一个Archlinuxer表示centos(或者说rpm系列?)的mariadb打包分得真细。

  哦,那些个什么service xx start的命令在很多新版本的linux发行版上已经不适用了,正确的打开方式是systemctl  [option] [xx],mariadb(mysql)使用:

 $ systemctl start mariadb

centos何时用systematl的我不知道,至少centos7用systemctl。开机自启动:

$ systemctl enable mariadb

(闲话)网上一堆老的不能再老的网页内容实在让菜鸟如我又不爱用什么centos(以及土豪reahat-贴吧常冒出新手问古董redhat的问题……所谓教材的毒害啊)十分无奈,解决不了啊。有说yum安装rpm的mysql(mariadb)默认mysql.sock文件不在默认位置即/var/lib/mysql/,而在/temp/xxx下,要修改my.conf(现在mariadb的配置文件是my.cnf,少了一个o)里面的sock配置,或者软链接到默认位置;有的说权限问题如何如何;有的说卸载安装如何如何………其实只是安装不完整的啦。我的印象里,debian用apt装软件,拖家带口的,aptitude install mysql的话,全家桶应该必然的。这个小问题让我一阵好找,原来只是没安装全,除了服务器我还真没怎么用过centos或者fedora,呵呵哒。

  




原标题:centos通过yum安装mariadb(mysql)无法启动服务或者找不到mysql.sock

关键词:MYSQL

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

研究海外仓的意义:https://www.goluckyvip.com/tag/47311.html
研究型广告:https://www.goluckyvip.com/tag/47312.html
研习社:https://www.goluckyvip.com/tag/47313.html
盐城综试区:https://www.goluckyvip.com/tag/47314.html
盐田快船:https://www.goluckyvip.com/tag/47315.html
颜Sir说:https://www.goluckyvip.com/tag/47316.html
无锡旅游景点竹海 - 无锡的竹海:https://www.vstour.cn/a/363178.html
5月贾汪好玩的地方 贾汪哪有好玩的地方:https://www.vstour.cn/a/363179.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流