1、新安装的mysql报错

MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)

解决方案

1、先停掉原来的服务

/etc/init.d/mysqld stop

2、使用安全模式登陆,跳过密码验证

mysqld_safe --user=mysql --skip-grant-tables --skip-networking&

或者上述两步可以使用如下操作

  在mysql的配置文件内加入:

  vim  /etc/my.cnf

  skip-grant-tables

  保存并重启mysql服务

3、进入mysql,修改密码:

mysql> use mysql;

mysql> update user set password=password("你的新密码") where user="root";

mysql> flush privileges;

mysql> quit

到此root账户就重置了密码,

  注意:如果使用配置文件了,需要删除etc/my.cnf中,刚添加的那行内容,重启mysql就好了

更新密码出错

  mysql> update user set password=password("你的新密码") where user="root";

  报错:ERROR 1054 (42S22): Unknown column 'password' in 'field list'

  解决措施如下:

  mysql>desc user;

  发现在Field列中没有password,此时我们需要这样重置密码:

  mysql>update user set authentication_string=password('123456') where user='root';

008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章

  1. 连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法

    1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输 ...

  2. MySQL登录报错"Access denied for user 'root'@'localhost' (using password: YES)"

    最近登录MySQL时候总报错: # mysql -uroot -p Enter password: ERROR (): Access denied for user 'root'@'localhost ...

  3. linux下mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法

    最近登录某台服务器的mysql时候总报错: Access[root@log01 ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Acc ...

  4. mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法

    环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...

  5. 连接数据库报错Access denied for user 'root'@'localhost' (using password:YES)

    报错信息为:pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using pa ...

  6. 运行JavaWeb项目报错Access denied for user 'root'@'localhost' (using password: YES)

    问题重现:(以下讨论范围仅限Windows环境): C:\AppServ\MySQL> mysql -u root -p Enter password: ERROR 1045 (28000):  ...

  7. 最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法

    1.关闭正在运行的MySQL.2.打开DOS窗口,转到mysql\bin目录.3.输入mysqld --skip-grant-tables回车.如果没有出现提示信息,那就对了.(正常的情况是光标闪烁没 ...

  8. MySQL5.7.20报错Access denied for user 'root'@'localhost' (using password: NO)

    在centos6.8上源码安装了MySQL5.7.20,进入mysql的时候报错如下: 解决办法如下: 在mysql的配置文件内加入: vim  /etc/my.cnf skip-grant-tabl ...

  9. mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法

    使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 文件内容: [client]host = localhostuser = debian-sys-maint ...

随机推荐

  1. 配置数据源和配置jpa的yml文件

    spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver username: root password: root url: j ...

  2. 《你说对就队》第九次团队作业:【Beta】Scrum meeting 2

    <你说对就队>第九次团队作业:[Beta]Scrum meeting 2 项目 内容 这个作业属于哪个课程 [教师博客主页链接] 这个作业的要求在哪里 [作业链接地址] 团队名称 < ...

  3. Ubuntu安装Apache 2.4.7常见问题解答

    环境:Apache 2.4.7 on Ubuntu 14.04 启动apache服务报错:Unknown Authz provider: ip 进入mod模块目录 cd /etc/apache2/mo ...

  4. Faster-RCNN用于场景文字检测训练测试过程记录(转)

    [训练测试过程记录]Faster-RCNN用于场景文字检测 原创 2017年11月06日 20:09:00 标签: 609 编辑 删除 写在前面:github上面的Text-Detection-wit ...

  5. FasfDFS整合Java实现文件上传下载功能实例详解

    https://www.jb51.net/article/120675.htm 在上篇文章给大家介绍了FastDFS安装和配置整合Nginx-1.13.3的方法,大家可以点击查看下. 今天使用Java ...

  6. [Kubernetes] Pod Health

    Kubernetes relies on Probes to determine the health of a Pod container. A Probe is a diagnostic perf ...

  7. YAML_05 定义一个变量创建用户,设置密码

    ansible]# vim user2.yml --- - hosts: cache   remote_user: root   vars:     user: wangwu   tasks:     ...

  8. (14)打鸡儿教你Vue.js

    重构 "代码重构" 为什么要进行重构 提高代码的可读性和可维护性 代码中存在着重复的代码 存在过大的类或过长的方法 强依赖.紧耦合的结构 运算逻辑难以理解 代码不能清晰 统一的编码 ...

  9. Python逆向(三)—— Python编译运行及反汇编

    一.前言 前期我们已经对python的运行原理以及运行过程中产生的文件结构有了了解.本节,我们将结合具体的例子来实践python运行,编译,反编译的过程,并对前些章节中可能遗漏的具体细节进行补充. 二 ...

  10. Pytest权威教程26-示例和自定义技巧

    目录 示例和自定义技巧 返回: Pytest权威教程 示例和自定义技巧 这是一个(不断增长的)示例列表.如果你需要更多示例或有疑问,请联系我们.另请参阅包含许多示例代码段的 综合文档.此外,stack ...