Question

I have uploaded a .sql file that I've exported via phpmyadmin to Google Cloud Storage. When I attempt to import the file to Cloud SQL I get this error...

Failed to import gs://raven-bucket-345/db_raven.sql: mysql_query No database selected (CREATE TABLE IF NOT EXISTS `group` ( `groupID` int(11) NOT NULL AUTO_INCREMENT, `groupName` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `permissions` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`groupID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4) An unknown problem occurred (ERROR_RDBMS)

I've tried using the new interface as well as the old one but nothing works... Is there a specific way I am supposed to create the .sql file? I'm just using the default phpmyadmin settings. Any insight into this? Thanks.

UPDATE:It seems the DB name is in there. I've opened the .sql file. Sorry for the formatting. It's just a copy paste from the .sql file. This is the first line:

    -- phpMyAdmin SQL Dump -- version 3.5.1 -- phpmyadmin.net -- Host: localhost -- Generation Time: Jan 11, 2014 at 10:53 PM -- Server version: 5.5.24-log -- PHP Version: 5.4.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 utf8 */; -- 

--
-- Database: `db_raven`
--

-- --------------------------------------------------------

--
-- Table structure for table `curriculum`
--

CREATE TABLE IF NOT EXISTS `curriculum` (
  `curriculumID` int(7) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`curriculumID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

--
-- Table structure for table `group`

When I try use db_raven; it returns this in the log: Failed to import gs://raven-bucket-345/db_raven2.sql: mysql_query Unknown database 'db_raven' (use db_raven) An unknown problem occurred (ERROR_RDBMS) –

Was it helpful?

Solution

No database selected : The dump doesn't seem to contain the name of the database to use

You may need to add this line to the top of db_raven.sql

USE databasename; #(replace databasename with your db name)

You should also be about to select the default database using your admin interface

See Failed to import gs://bucket_name/Cloud.sql

OTHER TIPS

I had a few issues that were spitting out the ERROR_RDBMS error.

It turns out that google actually does have more precise errors now, but you have to go here

https://console.cloud.google.com/sql/instances/{DATABASE_NAME}/operations

And you will see a description of why the operation failed.

If you see nothing there its probably related to authentication, or permissions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top