473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Restoring Numeric Databases

Hi,

I'm developing a database application that uses numeric databases. At
this point not using numeric databases is not an option. Doing a
mysqldump works. However when trying to restore the database with
"mysql -u root -psecret < backup.sql" gives the following error
message:

ERROR 1064 at line 11: You have an error in your SQL syntax near
'123456789' at line 1

Line 1 has the following line:

CREATE DATABASE /*!32312 IF NOT EXISTS*/ 123456789;

I know this will generate an error. The correct syntax would be:

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `123456789`;

How can I use mysqldump and restore to work properly with numeric
databases?

Thanks for your help.
Raffi

Sep 2 '05 #1
4 1768
my guess is that you should post to the mysql forum as its not related to php.

mysqldump --help

but in mysql 5.0.9 it includes the ``, it could be me though

Paul
Sep 2 '05 #2
Raffi wrote:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ 123456789;
How can I use mysqldump and restore to work properly with numeric
databases?


Here's what I would try:

Edit the dump file to remove (or comment) the CREATE DATABASE statement.
There's also a "--no-create-db" flag for mysqldump to suppress the
CREATE DATABASE statement. See the docs:
http://dev.mysql.com/doc/mysql/en/mysqldump.html

Then create the database manually with a shell command like:
mysqladmin create 123456789

Then restore the database from the dump file, naming the database as an
argument on the command line:
mysql -D 123456789 < dumpfile.sql

Regards,
Bill K.
Sep 2 '05 #3
*** Raffi wrote/escribió (1 Sep 2005 19:46:54 -0700):
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `123456789`;

How can I use mysqldump and restore to work properly with numeric
databases?


http://www.hmug.org/man/1/mysqldump.php

-Q|--quote-names
Quote table and column names with `

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Sep 2 '05 #4
Alvaro G Vicario wrote:
*** Raffi wrote/escribió (1 Sep 2005 19:46:54 -0700):
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `123456789`;

How can I use mysqldump and restore to work properly with numeric
databases?


http://www.hmug.org/man/1/mysqldump.php

-Q|--quote-names
Quote table and column names with `

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--


Álvaro,

Thanks. This is what I needed. I had looked through the man pages
briefly yesterday but may have missed this option. I'll try a
dump/restore later today and see if all works as it should.

Raffi

Sep 2 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kim | last post by:
How do I restore a single database (selectively) from a mysql dump of many databases. ie: I have a server with a few databases on it, I have run: mysqldump --all-databases > all_databases.sql ...
6
by: Edwinah63 | last post by:
Hi Gurus, i am having problems with restoring a ms sql database. i have restored the database using veritas to a different location ('g:\datafiles') in no recover mode. when i view the...
2
by: Raffi | last post by:
I use the --all-databases switch to backup my entire database. Sometimes there's a need to restore individual databases or tables form the backup file. What command should I use for this? ...
3
by: Raffi | last post by:
Hi, I'm developing a database application that uses numeric databases. At this point not using numeric databases is not an option. Doing a mysqldump works. However when trying to restore the...
3
by: rdemyan via AccessMonster.com | last post by:
I'm thinking about providing a relatively easy method for users to restore the front end from a backup. The purpose is to allow for restoring if the front end becomes corrupt. Here are some...
0
by: microsoft . public . sqlserver | last post by:
I have the back up of master(master_db.bak), distribution(distribution_db.bak), model(model_db.bak, model_tlog.trn), pubs(pubs_db.bak), Northwind(Northwind_db.bak),msdb(msdb_db.bak) and...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
1
by: Mr.Kane | last post by:
I have inherited a SQLS erver 2000 instance where the client never implemented a backup startegy for the "master" and "msdb" databases. MSDB is now showing errors and my only option for a restore...
0
by: DMT012 | last post by:
Hello. Occasionally on my production server when I run an automated script to restore a database from a backup it hangs and the database is put in restoring mode and just stays there, requiring me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.