Fix serialized data broken due to editing MySQL database in a text editor?

后端 未结 6 531
青春惊慌失措
青春惊慌失措 2020-12-30 02:25

Background: I downloaded a *.sql backup of my WordPress site\'s database, and replaced all instances of the old database table prefix with a new on

6条回答
  •  一整个雨季
    2020-12-30 03:27

    Visit this page: http://unserialize.onlinephpfunctions.com/

    On that page you should see this sample serialized string: a:1:{s:4:"Test";s:17:"unserialize here!";}. Take a piece of it-- s:4:"Test";. That means "string", 4 characters, then the actual string. I am pretty sure that what you did caused the numeric character count to be out of sync with the string. Play with the tool on the site mentioned above and you will see that you get an error if you change "Test" to "Tes", for example.

    What you need to do is get those character counts to match your new string. If you haven't corrupted any of the other encoding-- removed a colon or something-- that should fix the problem.

提交回复
热议问题