Navicat import Oracle data into mysql

If your Navicat does not have an option to connect to mysql, change it.

1. To complete the data migration, of course, a source database is required. In this example, the source database is Oracle and the target database is mysql. The reverse migration process is similar

2. First, create a table space for the target database on the target host. There is no data in the table space at this time.



3. Then, open Navicat and establish a connection from Navicat to the source database. Note that the data transmission of Navicat is actually data output rather than data import. It can be noticed by the connection icon and the connection port that the database connected to at this time is oracle.

Click Tools -> Data Transfer. Note that you must connect to the mysql library in advance to select it.



4. Establish a connection from Navicat to the target database. It can be noticed by the connection icon and the connection port that the database connected to at this time is mysql. Select the table to be copied and select the start directly, and it will be ok when it is over.

5. Right-click the connection of Navicat to the source database, select "Data Transmission", select the source database and target database in the pop-up prompt box, and click the "Start" button to start data transmission. If it is normal, the data migration can be completed.

problem:

1. After the data is migrated, the upper and lower case of the table name in Oracle is fine, but it is indicated in mysql that if it is uppercase, it may not be read in the code. According to the situation, it needs to be converted to lowercase;
2. If there are different versions of Navicat, there may be some There is no mysql connection option, so you can change the version;

3. Need to add related dependencies

<!-- MySQL -->
	<dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
		<version>${mysql.version}</version>
	</dependency>

4. Note that the driver of the Druid is not the previous one, you need to use the latest com.mysql.cj.jdbc.Driver

server:
  port: 8080
spring:
  application:
    name: TEST(TestApplication启动类)
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      filters: stat
      driver-class-name: com.mysql.cj.jdbc.Driver
      #基本属性
      url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
      username: root
      password: root
      #配置初始化大小/最小/最大
      initial-size: 1
      min-idle: 1
      max-active: 20
      #获取连接等待超时时间
      max-wait: 60000
      #间隔多久进行一次检测,检测需要关闭的空闲连接
      time-between-eviction-runs-millis: 60000
      #一个连接在池中最小生存的时间
      min-evictable-idle-time-millis: 300000
      validation-query: SELECT 'x'
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      #打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。分库分表较多推荐设置为false
      pool-prepared-statements: false
      max-pool-prepared-statement-per-connection-size: 20

 

 

 

 

Guess you like

Origin blog.csdn.net/Baron_ND/article/details/109773367
Recommended