在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

mysql出现1045错误怎么办

135次阅读
没有评论

共计 3283 个字符,预计需要花费 9 分钟才能阅读完成。

这篇文章给大家分享的是有关 mysql 出现 1045 错误怎么办的内容。丸趣 TV 小编觉得挺实用的,因此分享给大家做个参考,一起跟随丸趣 TV 小编过来看看吧。

–mysql5.6,安装好后进行登录出现
[root@mytest_db usr]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user root @ localhost (using password: NO)

提示密码问题,再用命令修改,也会出现以下错误
[root@mytest_db usr]# mysqladmin -u root password petrel
mysqladmin: connect to server at localhost failed
error: Access denied for user root @ localhost (using password: NO)

这个时候需要用这种方法进行处理
– 重启 mysql 服务,采用 mysqld_safe 的方式进行
[root@mytest_db usr]# service mysql stop
Shutting down MySQL…[  OK ]
[root@mytest_db usr]# mysqld_safe –user=mysql –skip-grant-tables –skip-networking
[1] 5043
启动后,就可以直接不用密码直接进入了,这个时候重新设置密码
[root@mytest_db usr]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

mysql use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql update user set Password=PASSWORD(petrel) where user = root
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql quit
Bye
[root@mytest_db usr]# service mysql restart
这个时候,再进行登录就没问题了

[root@mytest_db data]# mysql -uroot -ppetrel
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.19

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

登录后,需要再进行一次密码设置才能使用。
mysql use mysql;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql grant all privileges  on *.* to root@ localhost   identified  by petrel
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql set PASSWORD=PASSWORD(petrel
Query OK, 0 rows affected (0.00 sec)

– 出现 mysql.user 表里面用户为空时出现
ERROR 1045 (28000): Access denied for user
这个时候可以进行如下处理
删除这些为空的用户或者更新为其他用户名
删除 user.user 中值为 NULL 的, 或更新 NULL 为其它值等
mysql delete from user where user is NULL
Query OK, 1 rows affected (0.00 sec)
或者更新为其它值
mysql update user set user= mytest where user is NULL
Query OK, 1 rows affected (0.00 sec)

– 如果 mysql.user 表里面没有可以访问的用户,也会出现
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)
这个时候,我们就要采用如下步骤进行
[root@mytest_db usr]# service mysql stop
Shutting down MySQL…[  OK ]
[root@mytest_db usr]# mysqld_safe –user=mysql –skip-grant-tables –skip-networking
[root@mytest_db usr]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.
mysql select * from user;
发现没有用户
mysql INSERT INTO user(host, user, password, select_priv, insert_priv, update_priv) VALUES (localhost , username , PASSWORD(‘yourpassword), Y , Y , Y
Query OK, 1 row affected, 3 warnings (0.00 sec)

感谢各位的阅读!关于“mysql 出现 1045 错误怎么办”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-26发表,共计3283字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 国产精品a久久777777 | 久久这里只精品 | 日本1区二区三区公司 | 四虎影视网| 97福利在线 | 麻豆精品视频在线观看 | 精品成人乱色一区二区 | 久久综合国产乱子伦精品免费 | 天天躁日日躁狠狠躁av麻豆 | 亚洲欧美日本视频 | gav在线| 久久国产精品免费看 | 亚洲精品电影久久久影院 | 久久精品国产亚洲av麻豆~ | 欧美黄色大片免费观看 | 亚洲爆乳无码精品aaa片蜜桃 | 99这里只有精品6 | 中文无码制服丝袜人妻av | 久久av无码精品人妻系列试探 | www.亚洲国产 | 99精品视频免费观看 | 全部免费的毛片在线看青青 | 国产成人免费a在线资源 | 亚洲一区国产 | 嫩草影院地址一地址二 | 国产精品亚洲精品观看不卡 | 国产裸体美女永久免费无遮挡 | 亚洲国产99在线精品一区二区 | 欧美性高清在线视频 | 亚洲精品久久久久午夜福禁果tⅴ | 丁香五月亚洲综合深深爱 | 一级片aaa| 欧美成人亚洲欧美成人 | 韩国一级片视频 | 亚洲午夜国产精品无码老牛影视 | 亚洲精品欧洲一区二区三区 | 国精一二二产品无人区免费应用 | 女人高潮内射99精品 | 国产五月色婷婷六月丁香视频 | 中文国产成人精品少久久 | 日韩亚洲av无码一区二区三区 |