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. [MFC美化] USkin使用详解-使用方法

    该种皮肤库资料很少,用法与前面几种类似. 它主要有:USkin.dll ,USkin.lib,USkin.h和Sakura.msstyles这四个文件.皮肤格式是.u3.SkinBuilder是USk ...

  2. iOS ARC与MRC混编的一些解决方法

    1. ARC & MRC 混合开发 在项目开发中,遇到使用MRC开发的第三方库怎么办? 例如:ASI 1> 尝试使用Xcode的转换工具(失败率比较高) 2> 在编译选项中,为MR ...

  3. 何为PostgreSQL?

    PostgreSQL 是以加州大学伯克利分校计算机系开发的 POSTGRES, Version 4.2 为基础的对象关系型数据库管理系统(ORDBMS).POSTGRES 领先的许多概念只是在非常迟的 ...

  4. 整理一些css在使用中的小技巧(进行中)

    1. 消除li排列display:inline-block的间隙 ul{ font-size:; } ul li{ display:inline-block; }

  5. Laravel生成编译文件权限问题

    sudo -unobody ./artisan optimize # 避免`fpm`账户无权限修改缓存文件的问题.这里的`nobody`改成实际的`fpm`用户名.

  6. 【转】Zookeeper-Watcher机制与异步调用原理

    声明:本文转载自http://shift-alt-ctrl.iteye.com/blog/1847320,转载请务必声明. Watcher机制:目的是为ZK客户端操作提供一种类似于异步获得数据的操作. ...

  7. Scala内部类

    注意:Java内部类从属于外部类,而Scala内部类从属于对象(外部类的实例本身).

  8. 关于在vs中添加生成命令时的注意事项

    涉及到目录最好用双引号括起来,防止在目录含有空格或文字时发生错误.例如 del "$(SolutionDir)\..\xxxxxx\xxxx\Build\*.*" /s /q xc ...

  9. lucene 自定义评分

    摘自:http://blog.csdn.net/seven_zhao/article/details/42708953 1.基于FunctionQuery,(1)创建类并继承ValueSource:( ...

  10. 关于angularjs依赖注入的整理

    初学angularjs阶段,刚刚看到菜鸟教程的angularjs依赖注入.现在整理一下: 1.含义:一个或更多的依赖(可以理解为模块关系依赖)或服务(分为内建服务[例如$http,$tiomeout等 ...