Data Migration from SQL Serever Express 2008 R2 to MySQL 5 - mysql

I am trying to copy a database from SQL Server 2008 Express to MySQL using the MYSQL Migration Toolkit on Windows and keep getting the following connection error.
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://localhost:1433/ePacro2.0;user=sa;password=xxxxxx;charset=utf-8;domain=
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringMssql.getSchemata :Network error IOException: Connection refused: connect
Details:
net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:372)
net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141)
com.mysql.grt.modules.ReverseEngineeringMssql.getSchemata(ReverseEngineeringMssql.java:99)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)
Would you have any idea why this is failing?
I've also tried to export from SQL express 2008 but it won't let me choos a MySQL ODBC connector for my destination.

Having ODBC driver for MS SQL server database, you could try Data Import tool in dbForge Studio for MySQL.

Related

Jenkins pipeline throwing CLIENT_PLUGIN_AUTH is required error for mysql connection

I was trying to establish connection to mysql database, using Jenkins pipeline and when do that I get the following error:
com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
MySQL db version is 5.1.73
For the same database when I use mysql-connector-java-5.1.39-bin.jar in a Java program I was able to establish connection. But for the version below , higher or the same mysql-connectors I was not able to connect using Jenkins pipeline.
I searched internet and was not able to find a solution. Version compatibility was always mentioned as problem in some posts for this error trace in Java.
Plugins used in Jenkins are database & database-mysql
Here's my pipeline script
import groovy.sql.Sql
node{
Class.forName("com.mysql.jdbc.Driver")
dbConnection = Sql.newInstance("jdbc:mysql://localhost:3306/test", "username", "password","com.mysql.jdbc.Driver")
}

pentaho Mysql and connection issues

I use MacBook pro and I use last version Mojave for localhost I use XAMPP server , when I want to connect with DB the massage come :
Error connecting to database [LAB_DW]:org.pentaho.di.core.exception.KettleDatab aseException:
Error occurred while trying to connect to the database
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
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.
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)
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.
at org.pentaho.di.core.database.Database.normalConnect(Database.java:472)
at org.pentaho.di.core.database.Database.connect(Database.java:370)
at org.pentaho.di.core.database.Database.connect(Database.java:341)
at org.pentaho.di.core.database.Database.connect(Database.java:331)
at org.pentaho.di.core.database.DatabaseFactory.getConnectionTestReport(DatabaseFactory.java:80)
at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2786)
at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:619)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:313)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:157)
at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:141)
at org.pentaho.ui.xul.swt.tags.SwtButton.access$500(SwtButton.java:43)
at org.pentaho.ui.xul.swt.tags.SwtButton$4.widgetSelected(SwtButton.java:137)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.notifyListeners(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:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.pentaho.di.ui.xul.KettleDialog.show(KettleDialog.java:80)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
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.
... 80 more
Hostname :localhost
Port :3306
Database name :LAB_DW
some times I change the port to 8080 and same masses shown , I downloaded mysql-connector but I can't solve the problem !
Communication link failure. Please update the JDBC Driver according to the version of your .

Nifi Unable to Connect to Local MySQL

I have Mysql running locally on port 3306. Nifi is also set up and working. I have a simple flow between QueryDatabaseTable and SplitAvro as shown,
I have a DBCPConnectionPool controller set up as well,
Database Connection URL: jdbc:mysql://localhost:3306/formulae
Database Driver Class Name: com.mysql.jdbc.Driver
Database Driver Location: C:\Users\chetanyadav\Documents\mysql-connector-java-8.0.12\mysql-connector-java-8.0.12.jar
Database Name - formulae
Table Name - cell_lot
I am trying to access all records in my table using QueryDatabaseTable,
But I get this error,
I am unable to connect to MySQL basically and fetch the data from the tables.
Full Stack Trace of Error:
2018-09-18 09:52:30,917 ERROR [Timer-Driven Process Thread-1] o.a.n.p.standard.QueryDatabaseTable QueryDatabaseTable[id=d5293f61-0165-1000-cd8d-fe9155176abd] Unable to execute SQL select query SELECT * FROM cell_lot due to org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.cj.jdbc.Driver' for connect URL 'jdbc:mysql://127.0.0.1:3306/formulae
': org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.cj.jdbc.Driver' for connect URL 'jdbc:mysql://127.0.0.1:3306/formulae
'
org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.cj.jdbc.Driver' for connect URL 'jdbc:mysql://127.0.0.1:3306/formulae
'
at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:276)
at org.apache.nifi.dbcp.DBCPService.getConnection(DBCPService.java:49)
at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:84)
at com.sun.proxy.$Proxy102.getConnection(Unknown Source)
at org.apache.nifi.processors.standard.QueryDatabaseTable.onTrigger(QueryDatabaseTable.java:303)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1165)
at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:203)
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.cj.jdbc.Driver' for connect URL 'jdbc:mysql://127.0.0.1:3306/formulae
'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:273)
... 17 common frames omitted
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:315)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
... 20 common frames omitted
Any help is greatly appreciated!
I faced the same issue. I was using MySQL-connector.jar, I changed the connector to MySQL-connector-java-5.1.24-bin.jar and it worked. I Think there is a compatibility issue with new versions of the JDBC driver.

spring mvc 3 hibernate exception

I have a problem with the mysql connection, I use JPA / Hibernate 4 with spring mvc 3 / google app engine. I have the error locally or on the google app engine server.
org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [S1000]; error code [0]; Could not open connection; nested exception is org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:651)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:104)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy52.findByLogonemailAndPwd(Unknown Source)
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169)
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:82)
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
at com.sun.proxy.$Proxy64.prepareStatement(Unknown Source)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1739)
at org.hibernate.loader.Loader.doQuery(Loader.java:828)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
at org.hibernate.loader.Loader.doList(Loader.java:2463)
at org.hibernate.loader.Loader.doList(Loader.java:2449)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2279)
at org.hibernate.loader.Loader.list(Loader.java:2274)
note: Before the application works very well I reboot machine the error is appears.
thank you.
probably you haven't started your mysql server, eg: it's setup as a manual service / executable you have to run first
Maybe you can have a look at your configuration file to see the hostname of mysql server.

Migrating From MS SQL Server 2008 to MySQL

I have been put in charge of migrating the data out of an MS SQL Server 2008 database into MySQL. I have installed Microsoft SQL Server Management Studio, have started the SQL Server and SQL Server Browser services, have enabled the TCP/IP and Named Pipes protocols for the sql database via the SQL Server Configuration Manager, and created a user with access via SQL Authentication instead of Windows Authentication. I am trying to get the data out using MySQL Migration Tool. When I try to connect to the server I get the following error:
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ... Driver class MS SQL JDBC Driver Opening
connection ... Connection
jdbc:jtds:sqlserver://ukoff032/sqlexpress:1433/DbMain;user=remoteAccess;password=password;charset=utf-8;domain=
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringMssql.getSchemata :Network error IOException:
Connection refused: connect Details:
net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:372)
net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141)
com.mysql.grt.modules.ReverseEngineeringMssql.getSchemata(ReverseEngineeringMssql.java:99)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)
I have also attempted to add the MySQL ODBC 5.1 Driver so that I can export the data from SSMS but the driver does not appear in the export wizard's Destination options.
Can someone help me either get the MySQL ODBC Driver to show up in the SSMS export wizard destination options, or get MySQL Migration Tool to connect to the database and grab the data?
Thanks.
Try Data Import tool (ODBC format) in dbForge Studio for MySQL; or Data Export tool (ODBC format) in dbForge Data Studio for SQL Server.
I have used the SQL Examiner Suite. At first it did not work but after some digging found that the SQL being generated contained double-quotes around table names and columns (invalid SQL, basically). It does allow the user to edit the SQL before it is run so I had to go through the ~15 tables and delete the double-quotes around everything. Anywho - it works!!! Yay!