centos安装OpenStack error1045root访问受限

[root@localhost ~]# mysql -uroot -p000000
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@localhost ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@localhost ~]# mysql -uroot -p000000
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@localhost ~]# service mysqld stop
Redirecting to /bin/systemctl stop mysqld.service

[root@localhost ~]# whereis my
my: /etc/my.cnf
[root@localhost ~]# vi /etc/my.cnf
(在打开的文件中最后一行加入skip-grant-tables)

(重启数据库)
[root@localhost ~]# systemctl start mysqld.service mysqld start
Failed to start start.service: Unit not found.

(之前重启失败,试了一下其他语句 这是通过rpm包安装的MySQL可以用的)
[root@localhost ~]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
[root@localhost ~]# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.3.20-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> 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
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.059 sec)

MariaDB [mysql]> quit;
Bye
[root@localhost ~]# vi /etc/my.cnf
(把之前加入的skip-grant-tables删去)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值