如何安装mariadb服务器和解决 can't connect to local mysql server through socket...

  • 故障现象,
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
    一直 以为是 服务器安装错误, 而且用
    dnf info mariadb , 查看到的包的信息, 发现这个包 确实已经被安装过了.

但是 实际上这个包 仅仅提供的是 一个客户端client 的功能 . 并没有mariadb/mysqld服务器的功能!

可以看到, the base package contains the standard client mysql/mariadb program and generic mysql files , 即mariadb.i686这个包 只是包含客户端 程序, 并没有 服务器端 程序. 用 dnf seach mariadb , 可以看到 更多的结果: mariadb , maridb-server, mariadb-common, mariadb-config 等等相关的包. 所以 要安装 mariadb-server 这个包!

  • 在没有安装mariadb-server 这个包的时候, 用 systemctl list-unit-files |grep 'mariadb' 会 显示没有 这个相关的 unit单元.(所谓 unit 单元 , 就是 指 systemd 管理的系统服务和设备等, 包括 系统服务service, target, 设备device等等.

  • 当安装好 maridb-server包后, 就能查到对应的 mariadb.service了 当然, 也可以安装其他相关的 辅助包,比如 mariadb-common, mariadb-config等.

[lee@localhost ~]$ systemctl list-unit-files | grep 'mysqld'
[lee@localhost ~]$ systemctl list-unit-files | grep 'mariadb'
mariadb.service                             disabled
[lee@localhost ~]$ 

总之, 就是, 数据库服务器 是 mariadb.service ( 由mariadb-server包提供 ) , 访问服务器的客户端程序是mysql, (由mariadb包提供).

没有 /var/log/messages文件?
sticky位?http://www.cnblogs.com/fnng/archive/2012/05/06/2485973.html
cups服务https://code.evink.me/2017/12/post/how-to-disable-ubuntu-cupsd-server/
http://www.cnblogs.com/leaven/archive/2010/10/20/1856482.html

http://xshell.net/linux/cupsd_631.html

posted @ 2019-01-16 15:49  noitanym  阅读(1930)  评论(0编辑  收藏  举报