Migration ToolsDuring testing, powerdesinger was used to convert the table structure and Navicat was used to import data. The amount of data in the production environment is large, and colleagues in the data group will choose other tools to migrate it and supplement it when the time comes. Application transformation Add mysql8.0 driver packageUse mysql-connector-java-8.0.15.jar. If it is managed by Maven, add dependencies directly: <!--MySql Driver--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.15</version> <scope>runtime</scope> </dependency> Modify data source configurationspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://host:ip/database?useUnicode=true&characterEncoding=utf8 spring.datasource.username=root spring.datasource.password=password Object transformation
Problem Summary Problem: Local remote connection to MySQL database, report 10060 login exception
1. The network is not accessible; 2. The service is not started; 3. The firewall is not closed; 4. The firewall port on the server is not open; 5. The port is not being monitored; 6. Insufficient permissions. I am here to troubleshoot and find out why port 3306 on the test database server is not open.
sudo vim /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT sudo service iptables restart sudo iptables -L -n Problem: Navicat connecting to MySQL8 results in 2059 error
mysql -uroot -ppassword #Loginuse mysql; #Select databaseALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #Change encryption methodALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; #Update user passwordFLUSH PRIVILEGES; #Refresh permissions Problem: Using Navicat to migrate data reports an error --> [Err] [Dtf] 1426 - Too-big precision 7 specified for 'TIME_CREATE'. Maximum is 6.
Problem: Error when inserting varchar field during data migration --> Data too long for column 'DESIGNER' at row 1
Problem: SpringBoot connects to MySQL and reports an error --> Unknown system variable 'query_cache_size'
Problem: After changing to MySQL, the Chinese characters displayed in the front-end page of the application are garbled.
Finally, it was discovered that the encoding format was set to utf-8 in the Navicat connection, which caused the imported data to appear normal in Navicat, but garbled in the database and the query results. I really checked this for a long time, but I didn't notice the reason for the tool. .
The above are the details of the problems encountered and solutions when switching from Oracle to MySQL. For more information about switching from Oracle to MySQL, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: JavaScript Basics Variables
>>: VMware ESXI server virtualization cluster
Table of contents I've been learning React re...
1. Syntax TIMESTAMPDIFF(unit,begin,end); Returns ...
When using MySql's window function to collect...
When the amount of data in MySQL is large, limit ...
Table of contents Preface Reference Comparison Ma...
Songti: SimSun Bold: SimHei Microsoft YaHei: Micr...
1. Use the mysql/mysql-server:latest image to qui...
Problems that may arise from optimization Optimiz...
Several parts of Compose deal with environment va...
Detailed explanation of the misplacement of the in...
When we write some UI components, if we don't...
About Event: MySQL 5.1 began to introduce the con...
Table of contents Where is the source code of the...
This article describes the MySQL transaction mana...
This article shares the specific code of JS+AJAX ...