1

how to import .txt to mysql file?

I have a .txt file with hundreds of records and I want to import it into the mysql database table.

my txt file database is like that:

{"PAGE ID":{"title":"PAGE TITLE","description":"PAGE DESCRIPTION","username":"admin","tags":[TAGS],"type":"PAGE-TYPE","date":"PAGE DATE","dateModified":"PAGE DATE MODIFIED","position":0,"coverImage":"COVER IMAGE SRC","category":"PAGE CATEGORY","md5file":"PAGE MD5 FILE","uuid":"PAGE UUID","allowComments":true,"template":"PAGE TEMPLATE","noindex":false,"nofollow":false,"noarchive":false,"custom":[false]},

and all the other codes repeat like that.

I wonder how i can implement a formula to implement this txt file to mysql.

İlteriş
  • 11
  • 1
  • Have you defined a table to import to? – P.Salmon Jan 08 '21 at 15:32
  • You need to do more research and make some attempts yourself first. If you get stuck on something _specific_ with your code along the way, come back, show us what you've tried, the expected result and what results you're getting. The question is a bit too unspecific at the moment. – M. Eriksson Jan 08 '21 at 15:33
  • MySQL Shell 8.0 has a JSON import utility: https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-json.html – O.M.N.L Jan 08 '21 at 15:33
  • Does this answer your question? [How to import data from text file to mysql database](https://stackoverflow.com/questions/13579810/how-to-import-data-from-text-file-to-mysql-database) – manqlele Jan 08 '21 at 15:40
  • *my txt file database is like that* This value is not correct JSON from the MySQL point of view. – Akina Jan 08 '21 at 15:46

0 Answers0