一、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 [root@localhost etc]# service mysqld restart
Shutting down MySQL. [ OK ]
Starting MySQL. [ OK ] 3、登录数据库重新设置root密码 [root@localhost ~]# 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; 用新设的密码就能正常登录了; 原谅我没有认真学过mysql吧。以上都是在网上找到的解决办法,拿过来直接保存了。

mysql登录错误或者密码错误的更多相关文章

  1. MySQL程序端启动密码错误解决方法

    MySQL程序端启动密码错误解决方法 一般启动MySQL程序端,都是用mysql -uroot -p命令,当然前提是你的环境变量已经配好了. 为了连接服务器,当调用mysql时,通常需要提供一个MyS ...

  2. selenium(python)登录时账号密码错误提示语

    selenium(python)登录时账号密码错误提示语的获取 可以用text

  3. 在主函数中提示用户输入用户名和密码。另写一方法来判断用户输入是否正确。该方法分别返回一个bool类型的登录结果和和一个string类型的登录信息。如登录成功,返回true及“登录成功”,若登录失败则返回false及“用户名错误”或“密码错误”(使用out参数)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  4. mysql登录的root密码问题

    先说下场景:官网上下载mysql-5.7.18-winx64包,解压,设置环境变量完毕,执行install等命令安装完毕,一切正常,并未发现有什么问题. 然后使用客户端连接数据库时,死活报错:ERRO ...

  5. Docker windows nanoserver/mysql镜像root用户密码错误

    由于需要在Windows server上的Docker中部署mysql服务,为了方便起见所以在Docker hub找到了nanoserver/mysql (https://hub.docker.com ...

  6. mysql 登录后 修改密码

  7. navicat密码错误的问题

    上集说到我的navicat打不开对吧..‘ 这下就来聊聊打开了的问题 下午非常开心,就打开了mysql的图形化界面, 但是,在我连接数据库的时候就报错了 错误就是密码错误那行 什么什么‘localho ...

  8. asp.net 使用一般处理程序和ajax post实现登录以及记住密码

    1.登录页面login.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind=&qu ...

  9. 解决mac 下mysql安装后root用户登录密码错误问题

    使用的mac OS 10.11  安装mysql后访问root/root用户失败,网上找了一些解决办法,下面记录下解决方法方便以后自己查询 概述(看懂下面就不用看了): 停服务:sudo /usr/l ...

随机推荐

  1. QT-Creator C/C++ 打地鼠小游戏

    废话少说先上图: 这个游戏纯属土鳖思路,没有用到什么游戏引擎. 1.使用按钮或QLabel铺满窗口. 2.通过简单算法随机动态的设置按钮矩阵中某个按钮的背景图像. 3.同步2过程反复设置多个按钮背景实 ...

  2. 不用css样式表和背景图片实现圆角矩形,超简洁!

    当网站页面的整体布局设计好后,接下来有很多细节的实现是很让人头疼的.其中之一就是圆角矩形的实现. 在网上看了很多圆角矩形的实现方法,基本有两种,一种是用纯css实现,不需要背景图片:另一种是用背景图像 ...

  3. document_createElement

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  4. TcpClient

    public class TcpClientSession { protected TcpClient Client { get; set; } /// <summary> /// 远程地 ...

  5. C# 获取本机IP地址以及转换字符串

    /// <summary> /// IP地址转化 /// </summary> /// <param name="ipaddr">整型的IP地址 ...

  6. hdu1358Period

    Problem Description For each prefix of a given string S with N characters (each character has an ASC ...

  7. form表单中经常用到的禁用获取值问题

    <input name="country" id="country" size=12 value="disabled提交时得不到该值 " ...

  8. 使用CRT定位内存泄漏

    1. 使能内存泄漏检测#define _CRTDBG_MAP_ALLOC#include <stdlib.h>#include <crtdbg.h>注1:语句顺序不能修改:注2 ...

  9. mysql 更新 语句中 的 safe_mode

    在mysql5中,可以设置safe mode,比如在一个更新语句中UPDATE table_name SET bDeleted=0;执行时会错误,报:You are using safe update ...

  10. html5的video标签支持的视频格式