Results 1 to 3 of 3
  1. #1
    Join Date
    May 2013
    Posts
    1

    Unanswered: Sql Error While Importing to server

    Hey Guys,

    I am having following error while importing my sql file to the server.
    Can any one please tell what is the problem and how can I solve this?
    Code:
    SQL query:
    
    --
    -- Database: `bhoomidw_bull`
    --
    -- --------------------------------------------------------
    --
    -- Table structure for table `bhoomidwassets`
    --
    CREATE TABLE IF NOT EXISTS  `bhoomidwassets` (
    
     `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT  'Primary Key',
     `parent_id` INT( 11 ) NOT NULL DEFAULT  '0' COMMENT  'Nested set parent.',
     `lft` INT( 11 ) NOT NULL DEFAULT  '0' COMMENT  'Nested set lft.',
     `rgt` INT( 11 ) NOT NULL DEFAULT  '0' COMMENT  'Nested set rgt.',
     `level` INT( 10 ) UNSIGNED NOT NULL COMMENT  'The cached level in the nested tree.',
     `name` VARCHAR( 50 ) NOT NULL COMMENT  'The unique name for the asset.\n',
     `title` VARCHAR( 100 ) NOT NULL COMMENT  'The descriptive title for the asset.',
     `rules` VARCHAR( 5120 ) NOT NULL COMMENT  'JSON encoded access control.',
    PRIMARY KEY (  `id` ) ,
    UNIQUE KEY  `idx_asset_name` (  `name` ) ,
    KEY  `idx_lft_rgt` (  `lft` ,  `rgt` ) ,
    KEY  `idx_parent_id` (  `parent_id` )
    ) ENGINE = INNODB DEFAULT CHARSET = utf8 AUTO_INCREMENT =36;
    
    MySQL said: 
    
    #1046 - No database selected

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    "The #1046 - No database selected" message means that you tried to run a script (your file) without specifying which database to run that script against. MySQL needs to be told which database you want to run this script against.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    prefix the script with
    Code:
    USE bhoomidw_bull
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •