zoukankan      html  css  js  c++  java
  • 错误代码1045 Access denied for user 'root'@'localhost' (using password:YES)

    在mysql中新建连接,ip地址是127.0.0.1,账号是root,密码是123456,但是测试连接的时候报错,

    错误代码1045 Access denied for user 'root'@'localhost' (using password:YES)。

    看了很多篇别的博客,试验了下,发现解决方案。本人的mysql是5.6.26版本。

    首先,在cmd中切换到安装的mysql安装目录下的bin文件夹,使用net start mysql启动mysql服务

    再接着,输入指令mysql -u root -p

    出现的password,让你输入,直接按回车即可。此时的密码为空。

    输入指令show databases;注意分号

    输入指令user mysql;

    更改密码:update user set password=password('123456') where user='root';

    会出现更改成功,再接着刷新权限,然后退出,重新登录,mysql -uroot -p 

    这次输入密码123456,登录成功。

  • 相关阅读:
    POJ 1475 推箱
    POJ 2253 Frogger
    POJ 1970 The Game
    POJ 1979 Red and Black
    HDU 1546 Idiomatic Phrases Game 求助!help!!!
    Fibonacci 1
    BZOJ 1041
    椭圆曲线质因数分解
    奇怪的高精度
    数论v2
  • 原文地址:https://www.cnblogs.com/dushan/p/5949587.html
Copyright © 2011-2022 走看看