Skip to main content
Tony_See
Inspiring
December 15, 2016
Answered

DW and My SQL error must be obvious

  • December 15, 2016
  • 2 replies
  • 834 views

I'm building a site in DW CC on and i Mac with the latest MAMP Pro installed.

For various reasons I'm importing/Exporting sql files from live servers using PHP My Admin, and reimporting to a local site.

I'm getting the error msg below for one such import:

Error

SQL query:

CREATE TABLE IF NOT EXISTS `wp_commentmeta` (

  `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

  `comment_id` bigint(20) unsigned NOT NULL DEFAULT '0',

  `meta_key` varchar(255) DEFAULT NULL,

  `meta_value` longtext,

  PRIMARY KEY (`meta_id`),

  KEY `comment_id` (`comment_id`),

  KEY `meta_key` (`meta_key`)

) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9

MySQL said:

http://localhost:8888/phpMyAdmin/url.php?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Ferror-messages-server.html

#1046 - No database selected

Can anyone enlighten on the implications of this, and how it could be corrected?

The last line (#1046) . . . . I thought I'd dealt with that just prior to the export, but apparently not.

Thanks all

    This topic has been closed for replies.
    Correct answer BenPleysier

    This should help PhpMyAdmin Tutorial - Learn How to Manage your MySQL Databases

    2 replies

    Legend
    December 15, 2016

    So you have an .sql file exported from your remote server via phpMyAdmin?

    You have set up a database in your local server phpMyAdmin environment to import the .sql file into?

    You have selected the 'import' tab under the correct database in you local server via phpMyAdmin and browsed out to the .sql file you saved from the remote server?

    It sounds to me like you are just trying to import the remotely exported .sql file into your local version of phpMyAdmin without first setting up a database to receive it.

    Tony_See
    Tony_SeeAuthor
    Inspiring
    December 15, 2016

    That ( "without first setting up a database to receive it" ) could be a solution Ben

    I'll do that and post back the results.

    Many Thanks

    BenPleysier
    Community Expert
    BenPleysierCommunity ExpertCorrect answer
    Community Expert
    December 15, 2016
    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    BenPleysier
    Community Expert
    Community Expert
    December 15, 2016
    #1046 - No database selected

    Have you created and selected the database for the query to take effect?

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    Tony_See
    Tony_SeeAuthor
    Inspiring
    December 15, 2016

    Yes Ben

    Its running currently behind a live WP site, and I'm downloading it from Crazy Domains using PHP My Admin interface / Export.

    I thought I had carefully selected all the tables prior to export, and saved as a .sql file.

    No Joy