0

I used backpup plugin to backup my wordpress mu database :

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8mb4 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='SYSTEM' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


    --
    -- Table structure for `ftmt_2_commentmeta`
    --

    DROP TABLE IF EXISTS `ftmt_2_commentmeta`;
    /*!40101 SET @saved_cs_client     = @@character_set_client */;
    /*!40101 SET character_set_client = 'utf8mb4' */;
    CREATE TABLE `ftmt_2_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_520_ci DEFAULT NULL,
      `meta_value` longtext COLLATE utf8mb4_unicode_520_ci,
      PRIMARY KEY (`meta_id`),
      KEY `comment_id` (`comment_id`),
      KEY `meta_key` (`meta_key`(191))
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
    /*!40101 SET character_set_client = @saved_cs_client */;

I imported sql file in phpmyadmin in an existing wordpress mu database. But it fails at first instruction:

DROP TABLE IF EXISTS ftmt_2_commentmeta:

1046 - no database has been selected

I don't understand the error message as I am importing in current database so the database is implicitely selected.

2

Just add an USE statement to tell the server on which database you want the operation to be performed.

USE mydbname

| improve this answer | |

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