kettle连接数据库报错:Error occured while trying to connect
1 引言 在用kettle开发时常会出现 Error occured while trying to connect to the database 错误,但是仔细观察日志,引起这个错误的原因不尽相同。这个错误看起来很简单,但是有时候越简单的错误越没有耐心改,尤其是忙的时候,不小心填错了某个参数导致这
1 引言
在用kettle开发时常会出现 Error occured while trying to connect to the database 错误,但是仔细观察日志,引起这个错误的原因不尽相同。这个错误看起来很简单,但是有时候越简单的错误越没有耐心改,尤其是忙的时候,不小心填错了某个参数导致这个错误但是自己感觉没问题却跑不成功,这是最烦人的。这时候需要淡定、不妨上网查查,错误也许就可以愉快的解决了。下面给出这错误的更细节错误的不同发生情况。
2 示例
有个很简单的ktr脚本(当前kettle版本3.0.4),如下图:
表输入正常的配置信息如下:
下图 kettle安装文件目录是有jar包的情况:
按照上述配置,ktr脚本是可以正常执行完的。
1 首先来看 缺少ojdbc jar包的错
下图是ojdbc包被删除的情况:
日志信息:
重点是
exception while loading class oracle.jdbc.driver.OracleDriver。 意思是加载类 oracle.jdbc.driver.OracleDriver 异常 这很有可能就是jar包出问题。
2 下面是ip地址输入错误
日志给出的错误信息:
Io异常大概意思是:网络适配器不能建立连接。
3 数据库名错误
日志报错的情况:
An error occurred, processing will be stopped: Error occured while trying to connect to the database
2014/11/18 23:34:40 - 表输出.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 18:14:00) : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was:127.0.0.1:1521:orc
大概意思:监听由于下面的错误拒绝了连接:TNS(oracle 服务端和客户端通信协议)监听不知道当前的sid(数据库的唯一标示),这个sid在连接描述器中给出,使用这个描述器的客户端是127.0.0.1:1521:orc
4 端口号不正确
日志情况:
错误与ip地址不准确一样:
5 用户名或密码错误
用户名或者密码错误,日志信息都是如下:
大概意思是:无效的用户名或密码,登陆被拒绝
6 运行服务器没有权限访问远程数据库
从运行服务器ping 远程数据库机器ip:
从运行服务器telnet 远程数据库端口:
都是通的,但是表输出是这个 的脚本会报错:
logon rejected 拒绝登陆。运行脚本的机器没有访问数据库的权限导致此错误。
在这里 是表输出的数据库 设置了黑白名单 而运行服务器不在它的白名单里 导致此错误
3 总结
遇到类似的此类错误,需要淡定仔细的观察日志,使用排除法,才能快速的定位并解决掉问题。

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
