码迷,mamicode.com
首页 > 数据库 > 详细

MySQL问题

时间:2016-05-18 14:33:36      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

# mysql -u root mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

 

解决:[root@ZHT02 ~]#  /etc/init.d/mysql stop
Shutting down MySQL.. SUCCESS!
[root@ZHT02 ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 9707
[root@ZHT02 ~]# 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
[root@ZHT02 ~]# 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问题

标签:

原文地址:http://www.cnblogs.com/tianziru/p/5504963.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!