背景:windows环境下,Kettle连接本地MySQL报错
报错内容:
message from server: “Host is not allowed to connect to this MySQL server“
遇到该问题之前的准备:确保已将个人版本mysql驱动jar包放在\data-integration\lib文件夹下。具体如何操作请读者另寻文章解决,本文不在赘述。
报错原因:
数据库安装完成后,默认是不能远程登陆的,只能在本地用localhost 或者127.0.0.1登录访问,如果需要远程登录,则需要修改mysql设置,具体修改方式:
1、本地登录mysql:
[root@localhost ~]$ `mysql -u root -p`
2、查看数据库中mysql表中的权限设置:
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
3 rows in set (0.00 sec)
3、修改root用户权限:
mysql> update user set host = ‘%’ where user = ‘root’;
4、此时,root用户的权限已经允许非localhost登录
mysql> select host, user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| % | root |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+---------------+
3 rows in set (0.00 sec)
5、最后,刷新设置,即可远程登录
mysql> FLUSH PRIVILEGES;
————————————————
版权声明:部分内容为转载自CSDN博主「Julia_up」的文章
原文链接:https://blog.csdn.net/Julia_up/article/details/126776244