Home > Database > Mysql Tutorial > What should I do if an error occurs when importing data from the mysql command line?

What should I do if an error occurs when importing data from the mysql command line?

coldplay.xixi
Release: 2020-10-26 15:38:00
Original
3121 people have browsed it

Mysql command line import data error solution: 1. Enter [set global local_infile=1] on the command line Run, continue to enter [show variables like '%local%'] to run; 2. Convert the character encoding to [UTF-8 】.

What should I do if an error occurs when importing data from the mysql command line?

Solution to the mysql command line import data error:

1. Error 1

What should I do if an error occurs when importing data from the mysql command line?

Error reason:

MySQL: 6.1.6 Security Considerations for LOAD DATA LOCAL.

When using the local MySQL client to load data into the database, you need to obtain permission from the server.

The solution is as follows: set global variables and restart the client.

(1) Enter set global local_infile=1 on the command line and run;

(2) Continue to enter show variables like '%local%' and run. Will query the status of local_infile for on.

What should I do if an error occurs when importing data from the mysql command line?

(3) Restart the command line and re-import the data. (Be sure to restart, otherwise the imported data will lose records.)

2. Error 2

Cause of error: String encoding problem.

Solution: Use notepad to open the data file to be imported and convert the character encoding to UTF-8.

What should I do if an error occurs when importing data from the mysql command line?

More related free learning recommendations: mysql tutorial(Video )

The above is the detailed content of What should I do if an error occurs when importing data from the mysql command line?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template