MySQL问题
Posted 最美的时光-
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL问题相关的知识,希望对你有一定的参考价值。
# mysql -u root mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
解决:[[email protected] ~]# /etc/init.d/mysql stop
Shutting down MySQL.. SUCCESS!
[[email protected] ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 9707
[[email protected] ~]# 160518 13:37:27 mysqld_safe Logging to ‘/var/lib/mysql/ZHT02.err‘.
160518 13:37:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^C
[[email protected] ~]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.22-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
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> UPDATE user SET Password=PASSWORD(‘1234‘) 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
以上是关于MySQL问题的主要内容,如果未能解决你的问题,请参考以下文章