mysql错误2002的解决办法 ERROR 2002 (HY000) mysql.sock(2)
2016-03-22 21:25
821 查看
mysql安装错误ERROR 2002 (HY000)解决办法
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)问题解决过程,执行以下命令,看提示信息 #/usr/bin/mysql_install_db
Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h controller password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script!
执行 #/usr/bin/mysqld_safe & 执行完成MySQL2002错误就没有了,接着简单设置MySQL密码 #/usr/bin/mysqladmin -u root password 'new-password' 高级设置 Alternatively you can run: #/usr/bin/mysql_secure_installation
重启MySQL服务,现在可以用密码登录MySQL,而不会出现error 2002了。
虽然不知道具体的错误原因,但是以上办法的确可以决解问题。
相关文章推荐
- mysql 安装后报 ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- 爱分享 » 30多条mysql数据库优化方法,千万级数据库记录查询轻松解决
- mysql设置远程IP地址访问数据库
- MySQL数据引擎及索引介绍
- mysql
- MySQL之创建与操作数据表
- mysql多实例的配置(转)
- Mysql 命令行快速导入数据
- mysql 删除前几天记录
- MySQL 存储过程和函数(转)
- MySQL 批量Dll操作(转)
- mysql常用命令大全
- Ubutun 下的MySQL安装
- MySQL之数据类型
- mysql自增id获取失败
- mysql的基本操作1
- MySQL--Merge存储引擎
- 项目进阶 之 集群环境搭建(三)多管理节点MySQL集群
- 三个流行MySQL分支的对比
- mysql中的基本语句总结