首次安装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. windows server2012安装mysql时一直停留在start server的解决方法

    安装的时候,starting server 卡住 原因分析 这个问题小编安装mysql时也碰到过,出现这个问题是my.ini文件没有复制成功了,我们只要在mysql安装目录把把目录中的备份的my-sm ...

  2. JavaScript词法作用域经典练习题

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8& ...

  3. 解剖JavaScript中的null和undefined【转】

    在JavaScript开发中,被人问到:null与undefined到底有啥区别? 一时间不好回答,特别是undefined,因为这涉及到undefined的实现原理.于是,细想之后,写下本文,请各位 ...

  4. SpringCloud 教程 | 第一篇: 服务的注册与发现Eureka(Finchley版本)

    一.spring cloud简介 鉴于<史上最简单的Spring Cloud教程>很受读者欢迎,再次我特意升级了一下版本,目前支持的版本为Spring Boot版本2.0.3.RELEAS ...

  5. 教你制作高逼格的技术分享Keynote(PPT)

    本文来自 网易云社区 . 作为一个程序猿/媛,想必大家都参与过大大小小各式各样的技术分享,异或在不同的场合分享自己的技术心得.抛开分享内容的质量不谈,笔者发现通常这些分享者的演示文稿(Keynot或P ...

  6. fdisk 磁盘分区

    .[root@test4 ~]# fdisk /dev/sda //对sda磁盘进行分区 Device contains neither a valid DOS partition table, no ...

  7. “全栈2019”Java第二十八章:数组详解(上篇)

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...

  8. SPOJ 3267 DQUERY(离线+树状数组)

    传送门 话说这好像HH的项链啊…… 然后就说一说上次看到的一位大佬很厉害的办法吧 对于所有$r$相等的询问,需要统计有多少个不同的数,那么对于同一个数字,我们只需要关心它最右边的那一个 比如$1,2, ...

  9. Python strip()函数用法

    Python中字符串处理函数里有三个去空格(包括'\n', '\r', '\t', ' ')的函数: strip 同时去掉左右两边的空格lstrip 去掉左边的空格rstrip 去掉右边的空格 具体示 ...

  10. php 中将完整的年月日时分秒的时间转换成 年月日的形式

    strtotime() 函数将任何英文文本的日期或时间描述解析为 Unix 时间戳(自 January 1 1970 00:00:00 GMT 起的秒数), 将完整的时间格式转换成时间撮的形式,再去进 ...