今天安装mysql碰见几个问题,在这里整理
参考https://blog.csdn.net/faye0412/article/details/7038290
1.在开始启动的时候报如下错误,
ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.pid)
1.之前就存在mysql进程
解决办法:
a. 找到之前mysql、mysqld等和mysql相关进程并且杀死
lsof -i:3306
ps -ef | grep mysqld
b.有可能之前用mysql_safe无密码状态登录,删除进程即可
ps -ef | grep mysql_safe
kill -9 pid
2. 在使用mysql_safe命令之后,出现找不到3306端口,
链接https://blog.csdn.net/weixin_43671497/article/details/84931578
这是因为在命令中使用了
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
--skip-grant-tables : 跳过授权,不经过密码表
--skip-networking: 跳过tcp协议访问
如果使用 “mysqld_safe --user=mysql --skip-grant-tables --skip-networking &” 命令重启mysql服务,实现了免密登录,完成所需操作之后,一定要记得关闭参数skip-grant-tables 和skip-networking。