mac mysql连接报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
找了半天
又是kill进程,又是改设置文件,又是重启电脑,都不管用
翻到stackoverflow上的解决方案,实施成功:
原文链接:https://stackoverflow.com/questions/13480170/access-denied-for-mysql-error-1045
To restore it:
Stop mysqld deamons.
$ sudo service mysqld stop
Go to mysql/bin directory
$ cd /usr/bin
Start a mysql deamon with this option:
$ sudo mysqld_safe --skip-grant-tables
Open another terminal and open a mysql session to execute this:
$ mysql
mysql> use mysql;
see Note1 below for next line.
mysql> UPDATE user SET password=PASSWORD('YOUR_NEW_PASSWORD_HERE') WHERE user = 'root';
mysql> exit;
Now kill the mysqld_safe process and restart mysqld normally:
$ sudo service mysqld start
Note1: password is the column name in table mysql.user prior to version 5.7. After which it became authentication_string. Change your update statement accordingly.
有坑请注意:
1. 第一句“sudo service mysqld stop” 我电脑提示service: command not found,但是不执行这句好像也没什么关系
2.Note部分,password关键词在新版里已修改为authentication_string
感恩作者。
mac 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: YES)问题
问题描述: 在ubuntu14.04上安装完MYSQL后,MYSQL默认给分配了一个默认密码,但当自己在终端上使用默认密码登录的时候,总会提示一个授权失败的错误. 报错信息:Access denied ...
- 升级到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' ...
- 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: YES)) 修改: # ...
- 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...
- mysql安装在centos7报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
原文链接:http://blog.csdn.net/kuluzs/article/details/51924086 [问题]:mysql版本:5.7.13 首次在centos下安装MySQL,客户端连 ...
- 重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
出现报错: Warning: World-writable config file '/etc/my.cnf' is ignored // 该文件权限过高ERROR 1045 (28000): Acc ...
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit ...
- centos7 上安装mysql5.7后登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Yes 或者No)
原文转载自以下链接:https://blog.csdn.net/keepd/article/details/77151006 安装完mysql后会有个临时密码去日志查看,但是查看登录修改密后还是不行 ...
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...
随机推荐
- day 13 内置函数
内置函数思维导图:https://www.processon.com/view/link/5c13ad2de4b0ed122da75668 内置函数 作用域相关: locals() 返回当前作用域 ...
- 大数据学习--day06(Eclipse、数组)
Eclipse.数组 Eclipse 的基本设置 调节控制条字体大小. Window -> Preferences -> General -> Appearance -> ...
- PAT (Basic Level) Practice 1007 素数对猜想
个人练习 让我们定义dn为:dn=pn+1−pn,其中pi是第i个素数.显然有d1=1,且对于n>1有dn是偶数.“素数对猜想”认为“存在无穷多对相邻且 ...
- idea自动生成方法注释(含参数及返回值)
参考 https://blog.csdn.net/u014044812/article/details/76577479
- meta标签的总结
一.meta到底是什么? 英文解释:The <meta> tag provides metadata about the HTML document. Metadata will not ...
- [Real World Haskell翻译]第24章 并发和多核编程 第一部分并发编程
第24章 并发和多核编程 第一部分并发编程 当我们写这本书的时候,CPU架构正在以比过去几十年间更快的速度变化. 并发和并行的定义 并发程序需要同时执行多个不相关任务.考虑游戏服务器的例子:它通常是由 ...
- Java:List判空的条件:List=null 和 List.size = 0
当需要对一个LIst进行判空操作时我们可使用如下两个语句: if (list == null || list.size() == 0) {} if (list != null && l ...
- CakePHP2.x 发送邮件
cake提供了多种发送邮件的方法,并且简单实用.以2.x为例 第一步 创建并添加邮件配置信息 拷贝app\Config\email.php.default 为email.php 打开在EmailCon ...
- FastJson - 从HttpEntity到Json
在使用java + httpClient施行API自动化时,不可避免地遇到了如下问题: 1. 用Http Response数据做断言: 2. 用上一个请求的Response内容,作为下一个请求的参数: ...
- CentOS 7.2-编译安装zabbix 3.4
起因: 前面已经使用yum安装了zabbix 3.4了,准备去交差了,交差时老大明确要求必须使用编译安装,统一放在/usr/local目录下.... 重来吧!! 一.环境说明 本次安装使用CentOS ...