Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to attach a .sql file

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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