当前位置:Gxlcms > 数据库问题 > mariadb

mariadb

时间:2021-07-01 10:21:17 帮助过:2人阅读

-y install mariadb*

问题列表

  • ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)
    服务未启动service mariadb restart

启用handlesocket 插件

https://mariadb.com/blog/getting-started-mariadb-handlersocket-plugin

  • root用户下执行
    INSTALL PLUGIN handlersocket SONAME ‘handlersocket.so‘;
  • /etc/my.cnf中的mysqld章节 配置,至少添加以下内容
    1. handlersocket_address="127.0.0.1"
    2. handlersocket_port="9998"
    3. handlersocket_port_wr="9999"
  • 重新启动
    service mariadb restart
  • 检查状态
    show global variables like ‘handlersocket%‘
    show plugins
    show processlist

  • 安装客户端
    https://mariadb.com/kb/en/mariadb/handlersocket-client-libraries/
    https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL

问题列表

  • handlersoceket 没有错误,但是连接不了
    selinux需要设置为permissive setenforce 0
    http://stackoverflow.com/questions/26520626/unable-to-start-handlersocket-with-mariadb

  • [Warning] handlersocket: open_files_limit is too small.
    在/etc/my.cnf 中mysqld章节添加open_files_limit=10000,重启服务就可以了;
    10000 不要写太大,65535好像就是无效的
    https://ma.ttias.be/increase-open-files-limit-in-mariadb-on-centos-7-with-systemd/



来自为知笔记(Wiz)

mariadb

标签:

人气教程排行