Get the App
SLTechnology News&Howtos  ›  Database  › 

What if there is an error in mysqlimport import Datagram?

Shulou Source: shulou.com Published: 2022-05-31 19:10:52 10月17日 Update

This article mainly introduces "mysqlimport import data report error how to do", in the daily operation, I believe that many people have doubts about how to do mysqlimport import data report error. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "mysqlimport import data report error how to do". Next, please follow the editor to study!

MySQL Version 5.5.8

Import and export of load data related data

Export data:

Mysql > use DB_SPLIT_LOG

Mysql > select * from t_log_info into outfile "/ tmp/log_info.txt"

Clear the data:

Mysql > truncate table t_log_info

Import data:

Law one:

Mysql > load data infile "/ tmp/log_info.txt" into table t_log_info

Query OK, 4 rows affected (0.06 sec)

Records: 4 Deleted: 0 Skipped: 0 Warnings: 0

Law II:

Clear the data first:

Mysql > truncate table t_log_info

Root@192.168.12.160:tmp# mysqlimport-S / tmp/mysql3456.sock-pxxx DB_SPLIT_LOG t_log_info / tmp/log_info.txt

Mysqlimport: Error: File'/ opt/mysql558/DB_SPLIT_LOG/t_log_info' not found (Errcode: 2), when using table: t_log_info

As with the above error message, it was later found to be a grammatical error. Mysqlimport only needs to specify the database DB_SPLIT_LOG and does not need to follow the table name t_log_info.

Root@192.168.12.160:tmp# mysqlimport-S / tmp/mysql3456.sock-pxxx DB_SPLIT_LOG / tmp/log_info.txt

Mysqlimport: Error: Table 'DB_SPLIT_LOG.log_info' doesn't exist, when using table: log_info

As a result, there is another error, and the analysis shows that after mysqlimport specifies the database, how do you know which table the data belongs to? According to the file name! Meet the first point. 'The previous file name is both the table name

Root@192.168.12.160:tmp# mv / tmp/log_info.txt / tmp/t_log_info.txt

Root@192.168.12.160:tmp# mysqlimport-S / tmp/mysql3456.sock-pxxx DB_SPLIT_LOG / tmp/t_log_info.txt

DB_SPLIT_LOG.t_log_info: Records: 4 Deleted: 0 Skipped: 0 Warnings: 0

Import succeeded!

In addition, the essence of mysqlimport is to call the mysql load data command. If you need to prove that you can open binlog, then perform the corresponding operation to check.

At this point, the study on "how to report errors in mysqlimport import data" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Data what to do learning errors databases files file names more help utility success and then information just commands such as above articles methods both essence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL OPPO Reno Shulou Tech Info Xiaomi