• Max

    (@theserpent)


    Hello peep,
    I am reuploading a WP website Backup on a new host and when I import the SQL database from phpMyAdmin, a #1046 error comes in.

    Error

    SQL Request:

    — Table structure for table tranx_commentmeta

    DROP TABLE IF EXISTS tranx_commentmeta

    MySQL replied : Documentation
    #1046 – No database selected

    All I have is a text reader to check the database on my computer.
    Not sure what to do and couldn’t find much clues with Google,
    I just deleted this part of the DB file on the text reader :


    — Table structure for table tranx_commentmeta

    DROP TABLE IF EXISTS tranx_commentmeta;
    /*!40101 SET @saved_cs_client = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE tranx_commentmeta (
    meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    comment_id bigint(20) unsigned NOT NULL DEFAULT ‘0’,
    meta_key varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    meta_value longtext COLLATE utf8mb4_unicode_ci,
    PRIMARY KEY (meta_id),
    KEY comment_id (comment_id),
    KEY meta_key (meta_key(191))
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;


    — Dumping data for table tranx_commentmeta

    LOCK TABLES tranx_commentmeta WRITE;
    /*!40000 ALTER TABLE tranx_commentmeta DISABLE KEYS */;
    /*!40000 ALTER TABLE tranx_commentmeta ENABLE KEYS */;
    UNLOCK TABLES;

    and there were 5 others like this thereafter which I deleted aswell. (_comments, _ngg_pictures etc…) because they gave the same error.

    The 9.5 Mb database now mostly look like gibberish characters and loaded with long woocommerce shipping conditions,
    A bit heavy on my text reader and I dont know how to edit it further nor what should I edit…
    Maybe with a software (for Mac OS)?

    It was working fine on the other server, don’t know what functiunalities used the person who exported it..

    Your knowledge and help are very much appreciated!

    Thanks

    • This topic was modified 4 years, 9 months ago by Max.
    • This topic was modified 4 years, 9 months ago by Max.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I hope you have the original unaltered file still. It sounds like you tried to import the file into the server, hence the no database selected error. The export file was generated from a database already selected, so that aspect is missing from the file.

    In your new host’s phpMyAdmin, create a new DB for WP to use. Coordinate the DB name with the wp-config.php definition. In phpMyadmin, navigate to your new, empty DB and import from there.

Viewing 1 replies (of 1 total)
  • The topic ‘Database backup import error #1046’ is closed to new replies.