MYSQL登录错误:mysqladmin: connect to server at ‘localhost’ failed

一、mysql登录错误

mysqladmin: connect to server at ‘localhost‘ failed
       error: ‘Access denied for user ‘root‘@‘localhost‘ (using password: YES)‘

解决办法:破解mysql密码

#> service mysqld stop
       #>mysqld_safe --skip-grant-tables &
       输入 mysql -uroot -p 回车进入
       >use mysql;
       > update user set password=PASSWORD("newpass")where user="root";
       更改密码为 newpassord
       > flush privileges; 更新权限
       > quit 退出

service mysqld restart
       mysql -uroot -p新密码进入

 二,忘记本地root的登录密码

解决过程:

1、编辑/etc/my.cnf

在[mysqld] 配置部分添加一行

skip-grant-tables

2、保存后重启mysql

[[email protected] etc]# service mysqld restart
Shutting down MySQL.                                         [  OK  ]
Starting MySQL.                                                   [  OK  ]

3、登录数据库重新设置root密码

[[email protected] ~]# mysql -uroot -p mysql
Enter password:

直接回车进入

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.47-log Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

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

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
+--------------------+
3 rows in set (0.00 sec)

执行下列语句

mysql> update user set password=password("mysql") where user=‘root‘;
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

4、删除/etc/my.cnf文件中添加的“skip-grant-tables”行,重启mysql;

用新设的密码就能正常登录了;

时间: 2024-10-23 02:15:08

MYSQL登录错误:mysqladmin: connect to server at ‘localhost’ failed的相关文章

MYSQL登录错误:mysqladmin: connect to server at 'localhost' failed

一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user 'root'@'localhost' (using password: YES)'无法修改密码用 service mysqld stopmysqld_safe --skip-grant-tables &输入 mysql -uroot -p 回车进入>use mysql;> update user set

mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'

就当作自己忘记Mysql密码把,忘记密码的解决方法 一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user 'root'@'localhost' (using password: YES)'无法修改密码用 service mysqld stopmysqld_safe --skip-grant-tables &输入 mysql -uroot -p 回车进入>use

MySQL root密码重置 报错:mysqladmin: connect to server at 'localhost' failed的解决方案

===========================================================二,忘记本地root的登录密码解决过程:1.编辑/mysql/my.ini在[mysqld] 配置部分添加一行skip-grant-tables 2.保存后重启mysql[[email protected] etc]# service mysqld restartShutting down MySQL.                                      

MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed

MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed 1.安装完MySQL设置root密码报错如下 [root@vm172-31-0-6 data]# mysqladmin -uroot password "linux@123" mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root

mysqladmin: connect to server at 'localhost' failed

1:mysqladmin: connect to server at 'localhost' failed 2: 3: 4: mysqladmin: connect to server at 'localhost' failed

mysql登录错误或者密码错误

一.mysql登录错误 mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)' 解决办法:破解mysql密码 #> service mysqld stop #>mysqld_safe --skip-grant-tables & 输入 mysql -uroot -p 回车进入 >use my

Tomcat7改为6、Server Tomcat v6.0 Server at localhost failed to start.等错误

花了一上午的时间使用java开发了一个微信聊天机器人(我会将如何编写的过程分享给大家),号码为:qiubenlizi,大家有兴趣可以玩玩.当我将war包上传到SAE服务器的时候,运行出来的结果是这样 知道是服务器找不到文件,在本地上可是正常运行的,谷歌了一下, 说是SAE用的jdk1.6,而我用的事jdk1.7,tomcat也要相应的改成6,下面就讲一下如何转换 第一,将tomcat7里面的项目remove掉,并关闭: 第二,更改jdk1.6(首先你要有1.6的环境) 按照图示上,一步一步来 第

Android-67-Tomcat启动出错:Server Tomcat v7.0 Server at localhost failed to start.

 错误:Server Tomcat v7.0 Server at localhost failed to start.如图: 唉!!!!图片上传不上去,悲哀啊!!!只能先写着错误提示语吧~~- 解决办法: 1.In Eclipse, Open the"Server" tab. 2.Double click on the "Tomcat6" entry to see the configuration. 3.Then click on the "Open

Server Tomcat v7.0 Server at localhost failed to start解决办法

今晚搞了下tomcat,在调试的时候发现报了这样一个错误Server Tomcat v7.0 Server at localhost failed to start 首先,确认了端口号8080是不是被占用: 在浏览器中访问(http://127.0.0.1:8080)或运行telnet命令(telnet 127.0.0.1 8080)来验证端口是否被占用. 如果是,双击tomcat修改端口 经排查我这里不是这种情况,是由于电脑原因,导致启动时间超时,这么尴尬的原因也是没谁了,解决办法同样双击to