首页 > 代码库 > linux环境下安装mysql数据库遇到的问题
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)
linux环境下安装mysql数据库遇到的问题
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。