0

I am using:

mysql Ver 15.1 Distrib 10.3.31-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I have a wordpress db that I am trying to migrate from one dev environment to another, but I am getting this error when I try to import the db to the new location via phpmyadmin.

enter image description here

Does anyone know how I can resolve this? thx

How I made my dump.sql file: 1.) in the PMA for my old multisite installation (functioning, no problems), I login as a superuser (not root) that I created that has global GRANT ALL privileges on all dbs.

2.) I create a new dbuser that matches the dbuser on my target (new) multisite, -without- a default db.

3.) Then, I select the old multisite in pma -> operations and copy the desired db to a new db that has the same name as the user that I just created in step two

4.) THIS IS WHEN THINGS GET WEIRD After the new db has been created, inside pma I go to user accounts so that I can grant my new user all privileges on the new db. That's when I notice something weird in the title of db, that wasn't in the title of db when I used this same process to successfully migrate a different multisite. Screenshot: enter image description here

For reasons, unbeknownst to me, PMA is adding a "" to the dbname. And just to confirm, the name is shown correctly on previous screen: enter image description here

When I go back to pm -> user accounts -> databases, this is what I see:

enter image description here

5.) If I ignore the weird name and export the db to a .sql file, I get the error seen above, when I try to import.

9
  • Did you check that the dump you have is actually valid? This looks like you are trying to import a html page - possibly an error message instead of the dump.
    – jkavalik
    Commented Oct 24, 2021 at 17:05
  • The file which you want to import in HTML page, not a dump.
    – Akina
    Commented Oct 24, 2021 at 20:19
  • @jkavalik I added more information to my post to show how I created the .sql file and where I think the error came from
    – yupthatguy
    Commented Oct 25, 2021 at 0:33
  • @Akina I added more information to my post to show how I created the .sql file and where I think the error came from
    – yupthatguy
    Commented Oct 25, 2021 at 0:33
  • 2
    I added more information to my post to show how I created the .sql file This is not interesting. Simply open your file in any text editor and ensure that it contains SQL statements really and not HTML code (like MySQL reports).
    – Akina
    Commented Oct 25, 2021 at 5:03

1 Answer 1

0

Thanks for the assistance. The comment from @jkavalik above, led me to this posts:

phpmyadmin exports an .sql file that contains html (Stack Overflow)

Which explains that the easiest way to resolve the problem is to use command line to export the database, because my multisite has a large database.

mysqldump -u username -p db_name > dumpfile.sql

then:

mysql -u user -p db_name < dumpfile.sql 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.