Problem importing MySQL database

by 6 replies
7
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?
#programming #database #importing #mysql #problem
  • 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.
  • 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.
  • In PHPMyAdmin you need to select the database you need to import to.
    You can find some lists at the left side panel.
  • Try CREATE TABLE IF NOT EXISTS conks121_guitarlearningtv._ads
    • [1] reply
    • ... or just add:

      ... before all that other stuff in your SQL.
  • Great answer. This problem will fixed if you do it

Next Topics on Trending Feed