473,545 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
+ 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 1659
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
536
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 Which has created a nice file ..... Now what do I do if I just want to restore just one of the databases I have just dumped into this file. Thnks...
6
9595
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 database through the Enterprise Manager, it shows the database as silver icon (loading).
1
2267
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
3232
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? Thanks, Raffi
4
1774
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 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...
3
2734
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 particulars about my app 1) The front end is distributed as a .mde file. 2) Front end uses workgroup security 3) A separate logon form is used to...
0
965
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 compny(compny_db.bak,compny_db.trn). I have to restore all these databases. What will be the correct sequence of Restoring these databases so that I retain...
5
6546
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. The SAS users are laughing because they can (to a certain extend) easily go back to an earlier SAS table by simply starting dsm. Of course, a flat...
1
1931
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 is from a tape backup of the server. Any thoughts..
0
3691
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 to delete the database and restore the backup manually and causing everything else to timeout (it's part of an update process that includes database...
0
7479
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7411
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7669
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7926
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7439
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
722
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.