I have a database which, because of a Vbulletin mod error during uninstall, has left me with a database I can't restore. It says there is a query for a table that doesn't exist and a username attached to the table. Is this fixable?

Dani AI

Generated

Following 's suggestion to try a fresh import, here is a compact, practical workflow to pinpoint and fix the failing SQL in a large dump without opening it in a GUI editor. The steps cover identifying the exact failing statement, extracting a small context to inspect, and safe edits you can make (or alternatives) so the import completes cleanly.

  1. Capture the mysql error and the reported line number (mysql prints "at line N"). Use that line number to extract a small snippet for inspection:

    sed -n '12330,12360p' dump.sql

    Replace the numbers with the error line +/- a few dozen lines.

  2. If the import error names a table, locate its CREATE and any related statements:

    grep -n "CREATE TABLE \`the_table_name\`" dump.sql
    grep -n "INSERT INTO \`the_table_name\`" dump.sql
  3. If the dump contains a username attached to routines/triggers (DEFINER or GRANT statements), remove or neutralize those clauses before re-importing. Example: remove DEFINER clauses in a copy of the dump (do this on a copy only):

    perl -0777 -pe 's/DEFINER=`[^`]+`@`[^`]+`//g' dump.sql > dump.nodefiner.sql
  4. For very large files, split to isolate the failing section, or import piecewise to avoid re-running everything:

    split -b 100M dump.sql part_
  5. Safer alternatives: create the missing user temporarily on the target server (if the dump references it), or run the import with --force to skip errors but then inspect schema/row counts closely.

Always test fixes on a throwaway server, keep backups of the original dump, and verify table counts and vBulletin integrity after restore. If the exact mysql error message and the snippet around the reported line are posted, further targeted edits can be suggested.

Recommended Answers

All 3 Replies

Do you have access to a backup file in plain text format?

I can back it up fine, although it is 800mb in plain text and near impossible for me to open in notepad or wordpad

Import the dump file into a fresh database. What is the error message? What is the code immediately before the place which the error message indicates?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.