Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Restoring a database from shell and sql dump
- Brian Sadler
September 22, 2005, 10:22 pm
rate this thread
unix/linux to allow me to restore a database from an sql dump...
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.
Re: Restoring a database from shell and 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.
If you just want to run the sql:
mysql -h 83200.mysql.com -u your_username -pyour_password 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
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum