首次安装mysql 启动 mysql -uroot 以下错误:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决方案:

vim /etc/my.cnf

在[mysqld] 部分添加以下一行。

skip-grant-tables  

重启mysql服务

systemctl restart mysqld.service

修改mysql密码

mysql> update user set authentication_string = password("XX@123") where user='root';
Query OK, row affected, warning (0.00 sec)
Rows matched: Changed: Warnings:

退出mysql, 把之前/etc/my.cnf文件中skip-grant-tables  注释掉。

重启mysql服务

进入mysql服务

mysql> SET PASSWORD = PASSWORD('XX@123');
Query OK, rows affected, warning (0.01 sec)

mysql安装启动 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章

  1. win10连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    win10中cmd连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...

  2. MySQL学习笔记——ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Enter password: E ...

  3. mysql登录遇到ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    执行mysql  -uroot  -p,出现如下问题 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pass ...

  4. Linux下mysql出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    安装: 1.新开的云服务器,需要检测系统是否自带安装mysql # yum list installed | grep mysql 2.如果发现有系统自带mysql,果断这么干 # yum -y re ...

  5. CentOS 7.6下解决登录MySQL时,ERROR 1045 (28000): Access denied for user root@localhost (using password: YES

    https://blog.csdn.net/sinat_35406909/article/details/79763782

  6. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因

    在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...

  7. MySQL密码正确却无法本地登录,ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    MySQL密码正确却无法本地登录 报错如下: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password ...

  8. 升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...

  9. 安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案

    本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rw ...

随机推荐

  1. java免费空间!最简单的openshift免费空间上传代码教程!和FTP一样简单!

    史上最简单的openshift免费空间上传代码教程!没有之一! 最近因为想弄一个免费的空间,而且最好是Java的空间,找了一大片,jsp的空间少不说,免费的更是寥寥无几. 找了一大推垃圾空间,终于让我 ...

  2. [GO]json解析到结构体

    package main import ( "encoding/json" "fmt" ) type IT struct { Company string `j ...

  3. SIP简介

    说明:以下内容来着之前下载的一份文档,现将概念部分摘录在BLog,如需要完整文档将放在文件中或留言. SIP简介,第1部分:SIP初探 时间:2006-04-07作者:Emmanuel Proulx浏 ...

  4. 第01章 ElasticSearch简介

    本章内容 Apache Lucene是什么. Lucene的整体架构. 文本分析过程是如何实现的. Apache Lucene的查询语言及其使用方法. ElasticSearch的基本概念. ELas ...

  5. Discovering Gold LightOJ - 1030 (概率dp)

    You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave c ...

  6. VMware安装Ubuntu分辨率无法适应屏幕的解决方法

    ​ 一开始虚拟机安装Ubuntu的时候遇到分辨率无法适应屏幕的时候,百度了一大堆都说使用xrandr命令来修改分辨率,但是还是无法适应1920x1080的屏幕,强迫症表示非常难受! ​ 然后在不知道是 ...

  7. OSI结构和TCP/IP模型

    TCP/IP层次模型共分为五层:应用层HTTP.传输层TCP.网络层IP.数据链路层Data-link.物理层physical. 应用层—应用层是所有用户所面向的应用程序的统称.ICP/IP协议族在这 ...

  8. SharpMap入门教程

    SharpMap是一个基于.NET Framework 4,采用C#开发的地图渲染引擎,非常易于使用.本教程针对SharpMap入门及开发,讲述如何基于SharpMap组件渲染Shapefile数据. ...

  9. Consul ACL

    consul自带ACL控制功能,看了很多遍官方文档,没有配置步骤https://www.consul.io/docs/internals/acl.html 主要对各种配置参数解释,没有明确的步骤,当时 ...

  10. 聊聊 JDK 阻塞队列源码(ReentrantLock实现)

    项目中用到了一个叫做 Disruptor 的队列,今天楼主并不是要介绍 Disruptor 而是想巩固一下基础扒一下 JDK 中的阻塞队列,听到队列相信大家对其并不陌生,在我们现实生活中队列随处可见, ...