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)

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

最新文章

  1. box-sizing重置盒子模型计算规则
  2. Python Paramiko模块
  3. 源码解析之setContentView
  4. 转:关于rename命令ubuntu下的用法
  5. hdu 5755 Gambler Bo 高斯消元
  6. debian安装jdk6
  7. 一张图理解RACSignal的Subscription过程
  8. ABP从入门到精通(2):aspnet-zero-core 使用MySql数据库
  9. python并发编程之多进程二
  10. path和classpath细节
  11. Spring 基础知识(一)基本概念 DI、IOC、AOP
  12. java几种垃圾收集方法和垃圾收集器
  13. Highcharts 使用
  14. linux之用户和用户组
  15. 自制TFT-Usart通信小项目资料打包
  16. php 中 &quot;&gt;&gt;&quot; &quot;&lt;&lt;&quot; 的含义
  17. maven入门安装及HelloWorld实现
  18. Devexpress WPF教程
  19. Haskell优雅的快排实现
  20. MySQL用全库备份数据恢复单表数据

热门文章

  1. Codeforces Round #390 (Div. 2)
  2. hibernate事务控制
  3. Winform DataGridView直接导出Excel
  4. Alamofire4.0&#160;在 CocoaPods无法更新的问题
  5. #数论-模运算#POJ 1150、1284、2115
  6. C# 导出Word
  7. WPF 命令的简单总结
  8. ios 开发证书 appids 描述文件关系
  9. myeclipse连接数据库oracle(添加jdbc.properties)
  10. 一.Maven的安装和配置整理