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 】.
Solution to the mysql command line import data error:
1. Error 1
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.
(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.
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!