This article describes how to import the data of an existing MySQL database into a Cloud Database. If you haven't already created a Cloud Database instance and an empty database to receive the imported data, you'll need to do that first.
The import process includes the following steps:

mysqldump -u username -p database_name > database_name.sql
database_name is the name of your existing datatabase. database_name.sql will be the name of the exported database file. Replace "username" with the username you use to access the original database.
On Ubuntu and Debian, install the client with the following command:
sudo apt-get install mysql-client
On Fedora and CentOS, install the client with this command:
sudo yum install mysql
mysql -h 31blah2d.rackspaceclouddb.com -u username -p database_name < database_name.sql
The database is imported and ready to accept new data.
How Do I Import a Large MYSQL Database
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

25 Comments
Got a packet bigger than 'max_allowed_packet' bytes
I was trying to restore a db to my brand new cloud database and got this error.
mysql -h myhost.rackspaceclouddb.com -u myuser -p --max_allowed_packet=2G dbname < ~/dump.sql
Enter password:
ERROR 1153 (08S01) at line 602: Got a packet bigger than 'max_allowed_packet' bytes
This is strange i guess since i run it with the option --max_allowed_packet=2G
Can you help me out?
thanks in advance
Re: max packet
Got a packet bigger than 'max_allowed_packet' bytes
Sorry to disturb again but this is something i am not getting done and it's getting me really frustrated.
I am pretty sure it is mysql server that is responsible for accepting more or lesse allowed packet size.
What it seems is that my cloud db server is rejecting that i overide that max_allowed_packet and it is ignoring the value turning this into an impossible db to restore.
Which i think is clearly not the kind of service you want ot provide.
So tell me please what other options i might have? split the dump ?
Best regards
André
Re: packet size
I'm really looking forward to
Split the Inserts.
"INSERT INTO tbl_name VALUES (1,2,3)"
This will break up the size of the "insert" statements in your exported SQL file.
I think that might just help. Another options may be to use a CSV file with the LOAD file command.
No root password available for cloud databases
mysql -h hostid.rackspaceclouddb.com -u user_name -p database_name < database_name.sql
You will be prompted for user_name's password. Use the user_name and password values you used to create your database in step 1.
Hope that helps.
Getting error
ERROR 1227 (42000) at line 7: Access denied; you need the SUPER privilege for this operation
Thanks,
Kalpesh
ERROR 2013 (HY000)
This occures during import mysql -h hostid.rackspaceclouddb.com -u root -p database_name < database_name.sql
re: Lost connection
re: Lost connection
root@*****:~# mysql -h *****.rackspaceclouddb.com -u ***** -p -e 'show databases;'
Enter password:
+--------------------+
| Database |
+--------------------+
| information_schema |
| ***** |
+--------------------+
re: Connection
Access denied; you need the SUPER privilege for this operation
MySQL said:
#1227 - Access denied; you need the SUPER privilege for this operation
re: Super privilege
I realise I do not have
re: Privileges
You might want to call our support number or create a support ticket for this issue. The support techs would be able to take a look at your account and might be able to see what's causing the problem with their greater access.
Otherwise, I'd take a look at the first few lines of the .sql file to see what instructions it tries to executed when you send it through the mysql import.
The error is when trying to
I used the API to create a ROOT user and restored the database as root instead, which has solved the problem.
re: Privilege
ERROR 2003 (HY000)
What do I need to do to overcome this?
re: Error 2003
3115b7a10372b173bcbec7bea9edc5101aae32b2.rackspaceclouddb.com
Also double-check that you're entering your root password correctly.
re: Error 2003
I'm not sure what you mean when you say "root password". I don't have a root password for the database server. On my cloud server, my database user is root, but I wasn't able to create a user on the database server named root, so in the mysql -h command I put the username that I created on the database server and then typed in the password for that user when prompted.
Re: Error 2003
and type in the password for that created user, I get the same error. It takes a long time before I get the error, so it appears to be a timeout.
Any guess what the problem is?
re: Error 2003
A timeout might be what I'd expect if the server and DB instance were in different regions, but since they're both in DFW that shouldn't be an issue. From what you've said, you're doing things right.
I suggest opening a support ticket via the Cloud Control Panel describing the problem. That would get the issue to support personnel who have access to your account, so they can troubleshoot more directly than I can.
re: Error 2003
The problem is most likely one of routes for the database instances missing from your cloud servers. Please review the following knowledge base article to add the missing routes to your cloud servers so they can communicate to database instances in the same datacenter:
http://www.rackspace.com/knowledge_center/article/database-as-a-service-network-routes
Once you know the routes are configured, you can try to connect to the database instance as long as it's created in the same datacenter. If you continue to experience problems after adding the route please let us know and we'll be glad to help you with this.
re: Error 2003
Add new comment