[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

How to attach a .sql file

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
tofitadmin
Asked:
tofitadmin
1 Solution
 
codezpCommented:
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
 
tofitadminAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now