欢迎投稿

今日深度:

mariadb ERROR 1045 (28000),mariadb28000

mariadb ERROR 1045 (28000),mariadb28000


opensuse安装完mariaDB 后还没有设置密码,输入mysql -u root -p, 登陆错误:
信息如下:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

解决方案来源: https://segmentfault.com/q/1010000002760358

1、 运行环境: mariadb
2、 操作系统: centos7
3、 问题如下

之前数据库设置的是有密码登陆,现在出现用密码不能登录,而无密码可以登录。登录后不能创建数据库。求原因

一下我的操作:

[root@localhost ~]# mysql -uroot -p123456
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
[root@localhost ~]# mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.41-MariaDB MariaDB Server

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

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

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| test |
+——————–+
2 rows in set (0.00 sec)

MariaDB [(none)]>

MariaDB [(none)]> create database test1;
ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘test1’
MariaDB [(none)]>

我试了网上的方法,如下:
1.关闭mysql

systemctl stop maraidb.sevice

2.屏蔽权限

mysqld_safe –skip-grant-table

屏幕出现: Starting demo from …..
3.新开起一个终端输入

mysql -u root mysql

mysql> UPDATE user SET Password=PASSWORD(‘newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;//记得要这句话,否则如果关闭先前的终端,又会出现原来的错误
mysql> \q

仍然不行,现在只能对数据库读,其他的操作都不能进行,求原因???

谢谢!!!

www.htsjk.Com true http://www.htsjk.com/mariadb/30560.html NewsArticle mariadb ERROR 1045 (28000),mariadb28000 opensuse安装完mariaDB 后还没有设置密码,输入mysql -u root -p, 登陆错误: 信息如下: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES...
相关文章
    暂无相关文章
评论暂时关闭