473,474 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
3 1647
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 #2
*** 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 #3
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 #4

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...
1
by: Tina | last post by:
Does anyone know if there are any issues with restoring Master DB onto a server running Standard Edition from a server running Enterprise Edition of SQL Server?
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? ...
4
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
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.