kettle连接mysql时出现问题

错误信息如下:

 错误连接数据库 [test] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database Error connecting to database: (using class org.gjt.mm.mysql.Driver)
null, message from server: "Host '127.0.0.1' is not allowed to connect to this MySQL server" org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database Error connecting to database: (using class org.gjt.mm.mysql.Driver)
null, message from server: "Host '127.0.0.1' is not allowed to connect to this MySQL server" at org.pentaho.di.core.database.Database.normalConnect(Database.java:)
at org.pentaho.di.core.database.Database.connect(Database.java:)
at org.pentaho.di.core.database.Database.connect(Database.java:)
at org.pentaho.di.core.database.Database.connect(Database.java:)
at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:)
at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:)
at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:)
at org.pentaho.ui.xul.swt.tags.SwtButton.access$(SwtButton.java:)
at org.pentaho.ui.xul.swt.tags.SwtButton$.widgetSelected(SwtButton.java:)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:)
at org.eclipse.jface.window.Window.open(Window.java:)
at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:)
at org.pentaho.ui.xul.swt.tags.SwtDialog.show(SwtDialog.java:)
at org.pentaho.di.ui.core.database.dialog.XulDatabaseDialog.open(XulDatabaseDialog.java:)
at org.pentaho.di.ui.core.database.dialog.DatabaseDialog.open(DatabaseDialog.java:)
at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:)
at org.pentaho.di.ui.spoon.delegates.SpoonDBDelegate.newConnection(SpoonDBDelegate.java:)
at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon.doubleClickedInTree(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon.access$(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon$.widgetDefaultSelected(Spoon.java:)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
null, message from server: "Host '127.0.0.1' is not allowed to connect to this MySQL server" at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:)
at org.pentaho.di.core.database.Database.normalConnect(Database.java:)
... more
Caused by: java.sql.SQLException: null, message from server: "Host '127.0.0.1' is not allowed to connect to this MySQL server"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at java.sql.DriverManager.getConnection(DriverManager.java:)
at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:)
... more

主机名       : localhost
端口           : 3306
数据库名:mysql

在网上搜了好多都说mysql-connector-java-5.1.26-bin没有在/data-integration/lib或者/data-integration/libswt/win64/下

但是上图可以看出我的jar包已在/data-integration/lib下

最后,解决方法是:

1. root使用密码123456(密码自己设置强度高点)从任何主机连接到mysql服务器的话。

 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

2. 允许用户root从的主机连接到mysql服务器,并使用123456作为密码

 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

3. 允许用户root从ip为127.0.0.2的主机连接到mysql服务器的dk数据库,并使用123456作为密码

 mysql> GRANT ALL PRIVILEGES ON dk.* TO 'root'@'127.0.0.2' IDENTIFIED BY '' WITH GRANT OPTION;

 Query OK, 0 rows affected (0.00 sec)

 mysql> FLUSH   PRIVILEGES;

 Query OK, 0 rows affected (0.00 sec)

授权完成后,再一次连接成功。

kettle连接mysql的更多相关文章

  1. kettle连接mysql数据库并进行数据分析

    1.数据库链接驱动 如果没有安装对应的数据库链接驱动,在数据库链接的过程中,可能会报某个数据库连接找不到的异常,因此需要下载对应驱动后(安装步骤可以参见“怎么在官网上下载java连接mysql的驱动j ...

  2. Kettle连接MySQL错误:OPTION SQL_SELECT_LIMIT=DEFAULT

    由于升级了MySQL到5.6,运行ETL报错: OPTION SQL_SELECT_LIMIT=DEFAULT 上网查询原来是MySQL的驱动版本不一致,之前的驱动不支持这样的写法,于是上网下载对应的 ...

  3. kettle 连接 mysql 出错 Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the ……

    解决办法:1: 首先,到官网下载mysql-connector-java. 2: 把驱动文件放置在data-integration\lib\ 目录下

  4. kettle通过SSH连接Mysql数据库(SSH隧道)

    kettle通过SSH连接Mysql数据库(SSH隧道) Kettle无法直接连接使用SSH通道的MySQL,通过SSH隧道(推荐)或者需要借助工具PuTTY(不用时需要注销不推荐),具体操作如下所示 ...

  5. Python 2.7_pandas连接MySQL数据处理_20161229

    在我本地Mysql_local_db数据库建立了一个pandas数据表用来对pandas模块的学习 学习过程借鉴学习蓝鲸的网站分析笔记 1.创建表 CREATE TABLE pandastest( 城 ...

  6. nodejs进阶(6)—连接MySQL数据库

    1. 建库连库 连接MySQL数据库需要安装支持 npm install mysql 我们需要提前安装按mysql sever端 建一个数据库mydb1 mysql> CREATE DATABA ...

  7. 【初学python】使用python连接mysql数据查询结果并显示

    因为测试工作经常需要与后台数据库进行数据比较和统计,所以采用python编写连接数据库脚本方便测试,提高工作效率,脚本如下(python连接mysql需要引入第三方库MySQLdb,百度下载安装) # ...

  8. Node.js Express连接mysql完整的登陆注册系统(windows)

    windows学习环境: node 版本: v0.10.35 express版本:4.10.0 mysql版本:5.6.21-log 第一部分:安装node .Express(win8系统 需要&qu ...

  9. PDO连接mysql数据库

    1.PDO简介 PDO(PHP Data Object) 是PHP 5 中加入的东西,是PHP 5新加入的一个重大功能,因为在PHP 5以前的php4/php3都是一堆的数据库扩展来跟各个数据库的连接 ...

随机推荐

  1. scip学习

    最近在学习scip  准备把里面比较有价值的题分别用lisp和c语言写出来.这样或许能更加深入的理scheme的函数式编程. tip:我用的c语言环境是vs2015,lisp环境为Drracket;

  2. Front-End(一)

    前端初识 现在网站开发的市场越来越大,个人和企业都有了主页.网络办公的需求,并且随着网站开发前端和后台的工作细分,前端开发的需求也越来越大. 前端的任务是将美工的网页设计使用前端技术尽可能无差别地实现 ...

  3. 百度移动搜索自动转码太坑爹,JS跳转地址会被抓取

    这段时间碰到个很崩溃的问题,一个页面通过 script 加载请求服务端进行统计再输出js进行跳转,分为两个步骤分别统计, 打开页面通过script 请求远程服务器进行统计并输出要通过js使页面跳转的最 ...

  4. IOS Android支持中文与本地文件的读取写入

    转自http://www.xuanyusong.com/archives/1069 和http://www.benmutou.com/archives/2094 前几天有个朋友问我为什么在IOS平台中 ...

  5. Android 6.0之权限管理

    安卓6.0的权限体系分为非敏感权限和敏感权限,非敏感权限默认获取,可以手动关闭. 敏感权限必须由app在运行时动态申请.而存储读写空间权限是一个敏感权限,不是一个“很正常的必须权限”. 安卓并不是想要 ...

  6. Python学习笔记——基础篇【第五周】——算法(4*4的2维数组和冒泡排序)、时间复杂度

    目录 1.算法基础 2.冒泡排序 3.时间复杂度 (1)时间频度 (2)时间复杂度 4.指数时间 5.常数时间 6.对数时间 7.线性时间 1.算法基础  要求:生成一个4*4的2维数组并将其顺时针旋 ...

  7. dplyr 数据操作 常用函数(4)

    接下来我们继续了解一些dplyr中的常用函数. 1.ranking 以下各个函数可以实现对数据进行不同的排序 row_number(x) ntile(x, n) min_rank(x) dense_r ...

  8. Ubuntu 16.04安装和配置Sublime Text 3

    1.安装Sublime Text 3 首先添加sublime text 3的仓库: sudo add-apt-repository ppa:webupd8team/sublime-text-3 根据提 ...

  9. Gentoo网络管理方法总结

    OpenRC/netifrc Netifrc is a collection of modules created to configure and manage network interfaces ...

  10. 查询--游标 limit skip sort

    打印出所有的里程: var cursor = db.tblDaily.find(); cursor.forEach(function(x){ print(x.DailyCount + x.DailyU ...