惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cyberwarzone
Cyberwarzone
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
腾讯CDC
S
SegmentFault 最新的问题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Hacker News
The Hacker News
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
B
Blog
IT之家
IT之家
Spread Privacy
Spread Privacy
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cisco Blogs
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
AI
AI
I
InfoQ
H
Heimdal Security Blog
T
Threatpost
Cisco Talos Blog
Cisco Talos Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
W
WeLiveSecurity
SecWiki News
SecWiki News
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
O
OpenAI News
阮一峰的网络日志
阮一峰的网络日志
T
Troy Hunt's Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
雷峰网
雷峰网
T
Tor Project blog
有赞技术团队
有赞技术团队
Schneier on Security
Schneier on Security
Last Week in AI
Last Week in AI

博客园 - 子福当自强

vue element plus el-dropdown实现command传递多个参数最简单方式 centos 8 安装 nodejs npm centos 8 安装 minio centos 8 安装 ngingx 1.20 centos 8 安装 mysql 8 centos 8 安装 redis 6 centos 8 rpm安装oracle jdk 11 CentOS 8.2远程连接vncserver升级后1.10.1无法启动解决记录 Eclipse:Cannot complete the install because of a conflicting dependency.问题解决 Android SDK更新以及ADT更新出现问题的解决办法 Visual Studio 2013开启JavaScript的智能提示功能 linux中mysql密码找回的两种方式 Oracle 物化视图 说明 linux下mysql字符集编码问题的修改 mysql 启动错误-server PID file could not be found 在linux安装mysql,并设置远程访问 linux 下面 jdk1.7 rpm 包的安装 java数据库连接池性能对比 网页导航栏设计模式
mysql安装过程中出现错误ERROR 1820 (HY000): You must SET PASSWORD before executing this statement解决
子福当自强 · 2014-08-07 · via 博客园 - 子福当自强

mysql安装过程中出现错误ERROR 1820 (HY000): You must SET PASSWORD before executing this statement解决

最近新装好的mysql在进入mysql工具时,总是有错误提示:

# mysql -u root -p

Enter password:

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

或者

# mysql -u root -p password 'newpassword'

Enter password:

mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: YES)' 

现在终于找到解决方法了。本来准备重装的,现在不必了。

方法操作很简单,如下:

# /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' and host='root' or host='localhost';//把空的用户密码都修改成非空的密码就行了。

mysql> FLUSH PRIVILEGES;

mysql> quit # /etc/init.d/mysqld restart

# mysql -uroot -p

Enter password: <输入新设的密码newpassword>

MySql5.6操作时报错:You must SET PASSWORD before executing this statement解决

mysql>  SET PASSWORD = PASSWORD('123456');

Query OK, 0 rows affected (0.03 sec)

mysql> create database roger;

Query OK, 1 row affected (0.00 sec)

也就是用mysql>  SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!