Link to home
Create AccountLog in
Avatar of learnmoreeveryday
learnmoreeveryday

asked on

How to import RTF file to MySQL via Phpadmin

I wanted to restore a data from a previous backup using phpmyadmin.
The backup file was saved as RTF not mysql.
Is this file has the same structure as a file save as msql?
Is this possible to restore this file which is RTF format?
Or is there a way to convert it to msql format?
 
 
Many thanks,
Avatar of tigermatt
tigermatt
Flag of United Kingdom of Great Britain and Northern Ireland image

You cannot import RTF files to a MySQL database server because the RTF formatting obscures the plain text required to import the file. Is the contents of the RTF file the output from a previous phpMyAdmin "Export" operation? In this case it would be valid SQL and you can cut the text out of the RTF and paste into a notepad document. This saves the data as plain text and you can then use your saved notepad file to import into MySQL.

In future though it's a good idea not to use RTF files to save SQL data - just keep it in plain text format in .txt or .sql files.
Avatar of learnmoreeveryday
learnmoreeveryday

ASKER

[Is the contents of the RTF file the output from a previous phpMyAdmin "Export" operation?]

===> Yes.

[you can cut the text out of the RTF and paste into a notepad document. ]

===> I'm not sure which part should I cut. I saw it has some straight line like this  _______
while a mysql file has a dash line like this ------------

Do you think just simply rename RTF to txt will work?

Thank you so much!!!
ASKER CERTIFIED SOLUTION
Avatar of tigermatt
tigermatt
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thank you very much for your help.
i