[root@localhost mysql]# mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决方法:
方法一: 
# /etc/init.d/mysql stop 
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 
# mysql -u root mysql 
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES;

mysql> quit 
# /etc/init.d/mysql restart 
# mysql -uroot -p 
Enter password: <输入新设的密码newpassword> 
mysql>SET PASSWORD = PASSWORD('123456')

上面这一句必须要执行,要不然会出现“ERROR 1820 (HY000): You must SET PASSWORD before executing this statement” 的错误

linux安装mysql后root无法登录的更多相关文章

  1. linux安装mysql后root无法登录 sql 无法登录

    linux安装mysql后root无法登录 问题:[root@localhost mysql]# mysql -u root -pEnter password: ERROR 1045 (28000): ...

  2. linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

    我是小白,大佬勿喷 *** linux安装MySQL后输入mysql显示 ERROR 2002 (HY000): Can't connect to local MySQL server through ...

  3. yum安装mysql后root用户的临时密码

    1.查看root用户临时随机密码 yum 安装mysql后,无法通过空密码登录数据库,如下: [root@ mysql]# mysql -u root -p Enter password: ERROR ...

  4. Linux下mysql数据库root无法登录的情况

    今天安装lnmp环境后用mysql -u root -p连接密码后出现错误 Access denied for user 'root'@'localhost' (using password: YES ...

  5. linux上安装mysql以后root不能登录的解决办法

    今天心血来潮在linux上装了mysql,装完以后用命令mysql -uroot -p登录时提示 解决办法: 使用ps aux|grep mysql 查出pid 使用kill pid结束mysql进程 ...

  6. linux 安装mysql后修改密码出现问题

    新安装的mysql 执行命令时候出现错误: 一 错误信息: ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using ...

  7. 虚拟机下安装ubuntu后root密码登录失败的问题

    问题描述: 在虚拟机下安装了ubuntu中要输入用户名,一般情况下大家都会输入一个自己的网名或绰号之类的,密码也在这时设置过了. 但是当安装成功之后,使用命令#su root,然后输入刚才设置的密码, ...

  8. tar格式 方法安装MySQL后,初次登录出现 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

    参考: https://www.cnblogs.com/kerrycode/p/4368312.html http://blog.csdn.net/u014520039/article/details ...

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

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

随机推荐

  1. CentOS 7安装TigerVNC Server

    http://blog.csdn.net/wamath/article/details/76003128 1. CentOS 7安装TigerVNC Server 本文介绍如何在CentOS 7上安装 ...

  2. WinForm 弹窗

    private void FrmMyShow_Load(object sender, EventArgs e) { Rectangle r = Screen.GetWorkingArea(this); ...

  3. Bootstrap-CL:略缩图

    ylbtech-Bootstrap-CL:略缩图 1.返回顶部 1. Bootstrap 缩略图 本章将讲解 Bootstrap 缩略图.大多数站点都需要在网格中布局图像.视频.文本等.Bootstr ...

  4. [Octave] optimset()

    Create options struct for optimization functions. optimset('parameter', value, ...); %设置所有参数及其值,未设置的 ...

  5. linux-修改pip源

    1.进入家目录的隐藏 .pip目录下 cd ~/.pip 2.创建并修改pip.conf [global]timeout = 10  # 超时 index-url = http://mirrors.a ...

  6. Django学习---原生ajax

    Ajax 原生ajax Ajax主要就是使用 [XmlHttpRequest]对象来完成请求的操作,该对象在主流浏览器中均存在(除早起的IE),Ajax首次出现IE5.5中存在(ActiveX控件). ...

  7. OpenMP 简单的规约

    ▶ 简单的计算和规约 ● 第一种方法,将全局和的指针传入工作函数中进行加和,使用 critical 来控制临界区的访问 #include <stdio.h> #include <st ...

  8. mybatis 1 - 获取自增ID

    1.环境: mybatis : 3.2.3 spring-mybatis:  1.2.1 mysql:5.5.29 实体: public class sys_user { private int us ...

  9. leetcode763

    public class Solution { public IList<int> PartitionLabels(string S) { var dic = new Dictionary ...

  10. VS2013默认打开HTML文件没有设计视图

    打开VS菜单->工具->选项->文本编辑器->文件扩展名,右侧输入html,再下拉列表选HTML(Web窗体)编辑器,点添加,确定. 第二条是彻底解决VS2013不能编辑HTM ...