problem in restoring db script which backup from db_utility |
[eluser]Wades[/eluser]
Hi, I got a problem while restoring db from the script which created by backup function in db_utility. mainly because of some special characters like \n \r. here is the detail: suppose these is table called "test" : Code: CREATE TABLE test ( info TEXT NULL) Code: INSERT INTO test (info) values("here is my test data\n test data again") then I use the backup function to backup the data in this table and got a file with following content in it. Code: # and then I want to restore the table with the data in this file, here is my restore code: Code: $handle = fopen($filename, "r"); however, when I check the data in this table, the data becomes "here is my test data\n test data again", the special character '\n' becomes string "\n", that is to say that it doesn't restore the special character "\n" to what it should be, but as strng "\n" instead. this is the problem I got. is anyone can help? many thanks
[eluser]GSV Sleeper Service[/eluser]
why not just use LOAD DATA INFILE? it'll be a lot faster - http://dev.mysql.com/doc/refman/5.0/en/load-data.html
[eluser]Wades[/eluser]
thanks GSV, but as I know, LOAD DATA INFILE is mainly used to load data into a table from a file. but as I mentioned, the file I got from the backup function is a script with both data structure and data, so I think this may not help here. Is anyone ever met this problem before?
|
Welcome Guest, Not a member yet? Register Sign In |