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

总结一句话:
安装完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)
上一篇:设置chrome浏览器背景颜色


下一篇:转载:java web 项目中如何设置项目打开的默认页面