安装
yum -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章节 配置,至少添加以下内容handlersocket_address="127.0.0.1"
handlersocket_port="9998"
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需要设置为permissivesetenforce 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/