mysql错误:mysqladmin: connect to server at 'localhost' failed的解决方法 - PHPERZ中文资讯站 - 胜博发888手机平台

发布于 2014-12-06 16:48:29 | 2454 次阅读 | 评论: 1 | 来源: PHPERZ

这里有新鲜出炉的Mysql教程,程序狗速度看过来!

Mysql关系型数据库管理系统

MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司。MySQL被广泛地应用在Internet上的中小型胜博发888手机平台中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型胜博发888手机平台为了降低胜博发888手机平台总体拥有成本而选择了MySQL作为胜博发888手机平台数据库。


本文为大家讲解的是mysql错误:mysqladmin: connect to server at 'localhost' failed的解决方法,感兴趣的同学参考下。

错误描述:

登陆mysql失败,通过mysqladmin修改密码失败,如下:

[[email protected] var]# mysqladmin -u root password '123456'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

解决步骤如下:

1 停止mysql服务
[[email protected] var]# /etc/init.d/mysqld stop
Shutting down MySQL.... SUCCESS!

2 安全模式启动
[[email protected] var]# mysqld_safe --skip-grant-tables &
/opt/mysql/product/5.5.25a/bin/mysqld_safe --skip-grant-tables &
[1] 10912
[[email protected] var]# 110407 17:39:28 mysqld_safe Logging to '/usr/local/mysql/var//mysql.chinascopefinanical.com.err'.
110407 17:39:29 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var/

3 无密码root帐号登陆
[[email protected] var]# /usr/bin/mysql -uroot -p 【注释,在下面的要求你输入密码的时候,你不用管,直接回车键一敲就过去了】
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.1.41-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Database changed

4 手动update修改密码
mysql> update user set password=password("guxxxxxahyVh") where user='root' and host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
//更新权限表
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

//退出mysql
mysql> quit
Bye


5 正常重新启动
[[email protected] var]# service mysqld restart
Shutting down MySQL..110407 17:45:29 mysqld_safe mysqld from pid file /usr/local/mysql/var//mysql.chinascopefinanical.com.pid ended
SUCCESS!
Starting MySQL.. SUCCESS!
[1]+  Done                    mysqld_safe --skip-grant-tables

[[email protected] var]#

6 重新登录

[[email protected] var]# mysql -uroot -p123445
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 172
Server version: 5.1.41-log Source distribution


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> quit
Bye

搞定。



相关阅读 :
mysql错误:mysqladmin: connect to server at 'localhost' failed的解决方法
Mysql错误:Got a packet bigger than ‘max_allowed_packet’ bytes的解决方法
mysql错误:is marked as crashed and should be repaired解决方法
Starting MySQL.Manager of pid-file quit without updating file.[FAILED]的解决方法
mysql错误:SELECT command denied to user 'root'@'localhost' for table ...解决方法
mysql报错:MySQL server version for the right syntax to use near type=InnoDB的解决方法
Can't connect to MySQL server on 'localhost' (10048)问题解决方法
MYSQL无法启动提示: Default storage engine (InnoDB) is not available的解决方法
mysql Sort aborted: Out of sort memory, consider increasing server sort buffer size的解决方法
MySQL添加外键时报错:1215 Cannot add the foreign key constraint的解决方法
MySQL提示The InnoDB feature is disabled需要开启InnoDB的解决方法
mysql提示[Warning] Invalid (old?) table or database name问题的解决方法
最新网友评论  共有(1)条评论 发布评论 返回顶部
kbumdew 发布于2016-01-25 01:38:59
10W个赞,感谢楼主!!
支持(0)  反对(0)  回复
月排行榜

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  服务