473,395 Members | 1,647 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,395 software developers and data experts.

Restoring a database from shell and sql dump

Does anyone know where I can find information on how to setup my shell in
unix/linux to allow me to restore a database from an sql dump...

Example...

I have a database on 83200.mysql.com (example) that I have a file mysql.sql
(also just an example).

The file was produced using an sqldump command from a web interface...

How can I configure a connection if I am not on 83200.mysql.com so that I
can import the data into a database with a name of database_wordpress

Any help is greatly appreciated.

Sep 22 '05 #1
1 3879
>Does anyone know where I can find information on how to setup my shell in
unix/linux to allow me to restore a database from an sql dump...
You need to install the command-line client for your database, for
your example, it's called 'mysql' and might reside in /usr/local/bin/mysql,
on whatever machine you are doing this from.
Example...

I have a database on 83200.mysql.com (example) that I have a file mysql.sql
(also just an example).

The file was produced using an sqldump command from a web interface...
If you just want to run the sql:

mysql -h 83200.mysql.com -u your_username -pyour_password database_wordpress < mysql.sql

How can I configure a connection if I am not on 83200.mysql.com so that I
can import the data into a database with a name of database_wordpress


The host, username, password, and database parameters are for those
of the *DESTINATION* database. Depending on how the sqldump command
was done, it may have the database name(s) embedded in the mysql.sql
file and you might have to edit that file to change it. mysqldump
can, for example, put dumps of all tables in all databases into a
sql dump file, and it will switch databases inside the file.

Your database might be set to only allow direct database access
from specific hosts (like localhost only), "for your security". If
your database is run by a hosting company, there may be no way
around this restriction, other than putting your database on your
own server, or changing hosting companies.

Gordon L. Burditt
Sep 23 '05 #2

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

Similar topics

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...
5
by: Mike Nolan | last post by:
I have a 600K row table on my production system (running 7.3.3) that I dump and load on my development system (7.4.1) every night using cron jobs. I would like to be able to restore the table...
3
by: mike | last post by:
I have just upgraded froom Fedora test1 to test2 which has upgraded postgres version from 7.4.2 to 7.4.5 (frrom rpm -q) I have used pg_dumpall to dump my database, the restore appeared to go OK,...
3
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm restoring a database from 7.3.4 FC1 to 7.4.2 FC2: $ pg_restore -d KakaoStats KakaoStats.dump pg_restore: could not execute query: ERROR: could not access file...
4
by: Együd Csaba | last post by:
Hi, the restoration of a dump stops at the line above. The dump was created with pgsql 7.3.2 and I need to pump it into a 7.4.3 one. Should anybody tell me what the problem can be and how I can...
2
by: chenert | last post by:
Hi all, im beginner to restoring dump files and postgresql as well so hope u could bear with me.! :D i have these dump files and i've been working on restoring everything in it. i've tried...
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: ntech | last post by:
Hello, i am facing a problem. I am using postgresql database in Linux. After taking the dump of any postgresql database, when i restore the dump file into a new database, i dont get any oids. so can...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.