报错内容: 2002 can't connect to server on localhost 报错原因: Mysql服务未启动 解决方法: 启动MySQL服务即可。打开任务管理器,服务,找到MySQL服务将其启动即可。