Solved

How to attach a .sql file

Posted on 2008-10-10
2
306 Views
Last Modified: 2010-04-21
We backed up our mysql databases from our ubuntu server and need to re-attach them to another server.
I believe that all I need is the .sql file and need to run the attach command from the command line.  If this is correct what is the command?  For some reason I can't find the google answer.  Thanks in advance
0
Comment
Question by:tofitadmin
2 Comments
 
LVL 4

Accepted Solution

by:
codezp earned 125 total points
ID: 22689064
I am thinking instead of attach you want to import it to new server?

Something like this works:

$ mysql -u username -p -h localhost databasename < data.sql

hope that helps
0
 

Author Closing Comment

by:tofitadmin
ID: 31505115
thanks, that worked...
I used a GUI to do that but I was thinking that you could "attach" a database but instead I had to create one and then import the .sql file
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Showing random records from database 10 47
MySQL Backup Strategy 15 56
SubQuery link 4 44
How efficient to move databases to Azure? 5 56
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question