Problem importing MySQL database

6 replies
Hey all, I am trying to transfer a site to someone else's server. I am having problems with the MYSQL upload. Here is the error message PHPMYADMIN is outputting:


SQL query:

--
-- Database: `conks121_guitarlearningtv`
--
-- --------------------------------------------------------
--
-- Table structure for table `_ads`
--
CREATE TABLE IF NOT EXISTS `_ads` (

`ad_id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`ad_name` VARCHAR( 150 ) NOT NULL ,
`ad_group_id` INT( 11 ) NOT NULL ,
`width` VARCHAR( 4 ) NOT NULL ,
`height` VARCHAR( 4 ) NOT NULL ,
`code` TEXT NOT NULL ,
`position` INT( 2 ) NOT NULL ,
PRIMARY KEY ( `ad_id` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =14;

MySQL said:

#1046 - No database selected


Can anyone tell me what this means and how to fix it?
#database #importing #mysql #problem
  • Profile picture of the author aisdbuilder
    Hi there, the 'no database selected' seems to point that there isn't a database installed that you can import the tables to.

    In the upper left corner of phpmyadmin you should see a dropdown box with the available databases for that account.

    If you don't see anything besides 'information_schema' then you will have to create the database first.

    If there is an available database, select it, then import the sql query.

    Hope that helps.
    {{ DiscussionBoard.errors[6231159].message }}
  • Profile picture of the author soon
    Create a database on the newserver from cpanel. Name your database guitarlearningtv for legacy reasons.

    Then go to phpadmin and before entering the sql code make sure you select the database you created earlier from the left side menu. Once the db was selected run your import query. It should work ok.
    Signature

    The best seo software in this world..
    Need to write content fast? Use Voice Software or if you are in the health niche then buy Gerovital.

    {{ DiscussionBoard.errors[6231253].message }}
  • Profile picture of the author ivankristianto
    In PHPMyAdmin you need to select the database you need to import to.
    You can find some lists at the left side panel.
    {{ DiscussionBoard.errors[6234224].message }}
  • Originally Posted by Cataclysm1987 View Post

    Hey all, I am trying to transfer a site to someone else's server. I am having problems with the MYSQL upload. Here is the error message PHPMYADMIN is outputting:


    SQL query:

    --
    -- Database: `conks121_guitarlearningtv`
    --
    -- --------------------------------------------------------
    --
    -- Table structure for table `_ads`
    --
    CREATE TABLE IF NOT EXISTS `_ads` (

    `ad_id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
    `ad_name` VARCHAR( 150 ) NOT NULL ,
    `ad_group_id` INT( 11 ) NOT NULL ,
    `width` VARCHAR( 4 ) NOT NULL ,
    `height` VARCHAR( 4 ) NOT NULL ,
    `code` TEXT NOT NULL ,
    `position` INT( 2 ) NOT NULL ,
    PRIMARY KEY ( `ad_id` )
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =14;

    MySQL said:

    #1046 - No database selected


    Can anyone tell me what this means and how to fix it?
    Try CREATE TABLE IF NOT EXISTS conks121_guitarlearningtv._ads
    Signature
    {{ DiscussionBoard.errors[6234920].message }}
    • Profile picture of the author nmarley
      ... or just add:

      use conks121_guitarlearningtv
      ... before all that other stuff in your SQL.
      {{ DiscussionBoard.errors[6235530].message }}
  • Profile picture of the author michael0109
    Great answer. This problem will fixed if you do it
    {{ DiscussionBoard.errors[6235597].message }}

Trending Topics