Solved

How to attach a .sql file

Posted on 2008-10-10
2
289 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Does PHPMyAdmin pose a security risk? 2 95
Instering to MySQL table 5 38
Create a Select Query and Populate a Table 3 45
xampp tool 12 31
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
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…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now