作者:txy001美丽人生_618 | 来源:互联网 | 2023-10-13 08:51
[root@localhost /]# systemctl stop mariadb.service [root@localhost /]# mysqld_safe --u
[root@localhost /]# systemctl stop mariadb.service
[root@localhost /]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 46043
[root@localhost /]# 150131 03:15:27 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
150131 03:15:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql -u root mysql
MariaDB [mysql]> UPDATE user SET Password=PASSWORD('123123') where USER='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 3 Changed: 1 Warnings: 0
MariaDB [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> quit
Bye
[root@localhost /]# systemctl start mariadb.service
[root@localhost /]#
mariadb 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)