Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to ask your help how to import the sql text file. I'm testing a cms which is used in our company. and the IT give me a txt file so that I can copy it on my SQL database.

I have xampp. I'm going to test it first locally Any links or instructions on how to do it?

share|improve this question
The updated information you supplied fits into an entirely different topic. The question of importing and exporting SQL from mysql is done, successfully as it seems. You should formulate a new question with correct wording and fitting tags, as well as more information on the type of CMS you are using, or it will be difficult to help you. You should also think about accepting some of the answers you were given. – private_meta Aug 11 '10 at 13:09
i see thanks for the info, didn't know that I have to formulate a new question because it still on the same topic. ok I will do that then, apology – tintincutes Aug 11 '10 at 13:14
Well, the initial question you had wasn't about the CMS itself, it was just about mysql and exporting/importing. The added question was about Content Management Systems, which makes the topic different. It's somewhat like saying getting a drivers license and installing a car stereo are the same because they're both about cars. – private_meta Aug 11 '10 at 13:21
up vote 1 down vote accepted

If you're using Xampp, you'll be using MySQL. Xampp should contain the phpmyadmin package. I suggest you start looking there. It has "Execute SQL" options.

On the left, click the correct database if you need to create it first, then click "SQL".

If the SQL text file does the database creation for you, click the "SQL" button under the phpMyAdmin logo directly.

alt text

share|improve this answer
thanks. Yes i'm already in the localhost/phpmyadmin. I am actually set-up I just would like to have the copy of the live site to my local server. And I got the sql text file and wondering how to import it – tintincutes Aug 11 '10 at 12:13
@tintincute Check my updated answer – BloodPhilia Aug 11 '10 at 12:18
thank you very much.Will try that & will let you know ok? – tintincutes Aug 11 '10 at 12:26
Do i need to copy the text file and then paste it under Run SQL query/queries on server "localhost":. There is a white box here where you can type I guess and on the bottom right, there is a "Go" button – tintincutes Aug 11 '10 at 12:31
@tintincute That's right, copy the file's contents and paste it into the white box. – BloodPhilia Aug 11 '10 at 15:40

On Linux you might do something as easy as pipe the source file into the mysql executable

In Windows, except for phpmyadmin, you can do the following: Start mysql, then type

SOURCE <filename>


\. <filename>

to execute external files. Take care to use forward slashes in path names

share|improve this answer
@private_meta: i'm using XAMPP so I think I have to do it in the localhost/phpmyadmin and then from there i should do it. I just need the instructions here. because as far as I know you need to change the password or the username in the and not sure in which procedure. – tintincutes Aug 11 '10 at 12:17
If you are able to do it with phpmyadmin it's ok for you, but you don't necessarily need to use phpmyadmin just because you have xampp installed. Even with using xampp and having phpmyadmin installed you can still use mysqldump to export an sql file and use mysql (either with the source command in windows or linux, or just piping it in linux) to import it. One thing doesn't really exlude the other. – private_meta Aug 11 '10 at 12:24
@private_meta:thanks for the input.Haven't tried it yet.I'm using Windows 7. Yes Linux I think is also pretty simple but the rights and the commands sometimes make it complicated. – tintincutes Aug 11 '10 at 12:29
@private_meta:you said start mysql where can I do that? It's already running in the XAMPP icon as far as I can see – tintincutes Aug 11 '10 at 12:30
"mysql" is the synonym for the local mysql client. the mysql server that is already started is named "mysqld" for "mysql daemon". The executable for the client can be found in your xampp installation folder. Either switch to that folder, or add a path variable in your system. The default installation location for xampp, if i remember correctly, is C:\xampp, there you can search for mysql.exe On Linux machines, in case your server is one, the "mysql" executable should already be in the path, so typing "mysql" in the shell should suffice (if needed) – private_meta Aug 11 '10 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .