突然想到,既然mariadb兼容mysql,
并且systemctl start mysql 和systemctl start mariadb都可以启动mariadb。根本不知道启动谁
原因:
mariadb默认同时安装mysql.service(作为别名) ,mysqld.service(较少使用)与mariadb.service
实在想共存建议先安装mariadb
再安装mysql时,mysql的两个服务mysql.service 和mysqld.service会尝试注册和覆盖
解决方法:
可以unlink 删除mysql.service的符号链接,使其无法被systemctl调用
重新加载systemd配置
systemctl daemon-reload
我用的是debian,locate查询到该服务文件存储在 /usr/lib/systemd/system/下,并存在软连接
(其它系统 服务可能存储在/etc/systemd/system/)
为以后打算,建议只删除软连接即可
注:debian使用locate:需要apt install mlocate 并且输入updatedb更新数据库后