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

linux环境下安装mysql数据库遇到的问题

时间:2016-09-20 06:49:45      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:

总结一句话:
安装完mysql数据库记得授权远程登录。
 
坑的现象:
ERROR 1045 (28000): Access denied for user ‘guoxp‘@‘localhost‘ (using password: YES)
 
解决方案如下:
执行前查看状态:
MariaDB [mysql]>  select Host,User,Password from user ;
+-----------------------+-------+-------------------------------------------+
| Host                  | User  | Password                                  |
+-----------------------+-------+-------------------------------------------+
| localhost             | root  |                                           |
| localhost.localdomain | root  |                                           |
| 127.0.0.1             | root  |                                           |
| ::1                   | root  |                                           |
| localhost             |       |                                           |
| localhost.localdomain |       |                                           |
+-----------------------+-------+-------------------------------------------+
6 rows in set (0.00 sec)
 
 
授权:
MariaDB [mysql]> grant select,update,insert,delete on *.* to guoxp@远程登录的ip地址 identified by "远程登录的密码";
Query OK, 0 rows affected (0.00 sec)
 
执行后查看状态:
MariaDB [mysql]>  select Host,User,Password from user ;
+-----------------------+-------+-------------------------------------------+
| Host                  | User  | Password                                  |
+-----------------------+-------+-------------------------------------------+
| localhost             | root  |                                           |
| localhost.localdomain | root  |                                           |
| 127.0.0.1             | root  |                                           |
| ::1                   | root  |                                           |
| localhost             |       |                                           |
| localhost.localdomain |       |                                           |
| 远程登录的ip地址        | guoxp | *FA074CDA355DAA0D0E53ABE2885985ECEB743D7A |
+-----------------------+-------+-------------------------------------------+
7 rows in set (0.01 sec)

linux环境下安装mysql数据库遇到的问题

标签:

原文地址:http://www.cnblogs.com/jack1208-rose0203/p/5887338.html

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