連接MySql數(shù)據(jù)庫(kù)

報(bào)錯(cuò)一
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver

報(bào)錯(cuò)原因:這個(gè)報(bào)錯(cuò)的原因是因?yàn)楫?dāng)前的kettle目錄下沒有需要連接的數(shù)據(jù)庫(kù)驅(qū)動(dòng),所以我們需要下載一個(gè)驅(qū)動(dòng)放到他的lib包里重新啟動(dòng)即可,我創(chuàng)建的是mysql連接所以需要mysql連接驅(qū)動(dòng)
解決方法:
maven倉(cāng)庫(kù)下載合適的啟動(dòng)jar包,我選擇的是下載人數(shù)最多的
https://mvnrepository.com/artifact/mysql/mysql-connector-java
將下載好的jar解壓放到\data-integration\lib\的目錄下就可以了

再次進(jìn)行測(cè)試連接,可能會(huì)報(bào)這樣的錯(cuò)誤
錯(cuò)誤二:
Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

錯(cuò)誤原因:原因是因?yàn)闆]有選擇相應(yīng)的配置
解決方法:在選項(xiàng)中新增useSSL=false即可

再次進(jìn)行測(cè)試連接可能還會(huì)報(bào)這樣的錯(cuò)誤
Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解決方案:
設(shè)定mysql數(shù)據(jù)庫(kù)時(shí)區(qū)即可或者在kettle數(shù)據(jù)庫(kù)連接的選項(xiàng)中配置serverTimezone參數(shù),我使用的是后者。
show variables like '% time_zone%';
set global time_zone = '+8:00';文章來源:http://www.zghlxwxcb.cn/news/detail-479419.html


最后再次測(cè)試連接,成功。文章來源地址http://www.zghlxwxcb.cn/news/detail-479419.html

到了這里,關(guān)于kettle連接MySql啟動(dòng)報(bào)錯(cuò)常見錯(cuò)誤解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!