Import database mysql command line windows xampp

If you are a web developer, then you have to work on the web application. When we work on a web application, we will also launch it. You have to migrate the application to launch it, and everyone knows this. So when migrating, we have to migrate the database as well. We have two ways to migrate or import databases. Today in this post I will tell you how to import the database in both these ways. So this post is about how to import the databases from phpMyAdmin, and how to import the database from the MySQL command line.

Importing the database from phpMyAdmin is much easier. There can be two options for browsing this URL. Firstly, if you are using this on a Windows machine and you do not have a password set for phpMyAdmin, then you will see the index page of phpMyAdmin.

Whereas, if you are using the Linux system or you have a set password for your windows platform then you will get a login screen.

You will have to log-in with your username and password. This will take you to the index page. On the index page, you will find two panels, i.

The database will be created as soon as you click on the Create button. And now whatever operation you do will be on the same database. As, the phpMyAdmin switches to the database, as soon as it is created. Now you will see the name of the server and the database being used at the top of the panel. So you can know which database you are working on.

In the same row, you will see an option with the name Import. You have to click on it. As soon as you click, you will get a form for uploading a file. This form page will have a heading, I am mentioning below. You have to browse your data file by clicking on the Choose File button. The file can be in SQL format or in any other supported format.

Drop-down of the format will be changed as soon as the file is browsed only if the file is of a format other than SQLSQL is selected by default. Now, you just need to click on the Go button to import the data in that file. In a few seconds, your database will be imported and you can connect it with your PHP application, JSP application or any other application.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

[SOLVED] Easy way to import large database mysql phpmyadmin

I have wamp on my PC. Phpmyadmin does not work well with this size. I changed all parameters in php. But it does not work for me. So I want to import it by command line. If you have wamp installed then go to command promptgo to the path where mysql.

For an individual file, I like to use source more because it shows the progress and any errors like. If those commands don't seems to work -- I assure you they do -- check the top of your sql dump file for the use of :. First open Your cmd pannel And enter mysql -u root -p And Hit Enter After cmd ask's for mysql password if you have mysql password so enter now and hit enter again now type source mysqldata.

If you are running WampServer on your local machine, import means restoring the dump file that you have in sql format. It would be better to keep the dump file in the above directory we can delete, after restoration.

Learn more. Asked 7 years, 8 months ago. Active 2 years, 3 months ago. Viewed k times. Napster Napster 2, 2 2 gold badges 26 26 silver badges 50 50 bronze badges.

Active Oldest Votes. Tried this and it looks like it's working but I'm not getting any feedback in the command prompt. Are there any flags you can use to recieve feedback about the progress of the operation? Nanhe Kumar Nanhe Kumar Minhphuong Le Minhphuong Le 1 1 gold badge 1 1 silver badge 8 8 bronze badges. To import database from dump file in this case called filename. Chirag Shah Chirag Shah 1, 2 2 gold badges 16 16 silver badges 39 39 bronze badges.

This is wrong syntax. You should not use space between -p and password. Shal Shal 5 5 silver badges 7 7 bronze badges. For an individual file, I like to use source more because it shows the progress and any errors like Query OK, rows affected 0. Brandon Minnick 9, 12 12 gold badges 47 47 silver badges bronze badges.First you need to export the data. Import mysql db using command line is very simple statements, effective and fast compare to importing huge database from phpmyadmin.

Note: On the below screen command, you will define own define own database name.

import database mysql command line windows xampp

The database name will be the one that you created in the phpMyAdmin and would like to import to SQL file. Once your database SQL file successfully import then you will get following response like in the below image.

import database mysql command line windows xampp

MySQL query to find the highest salary from each department. Find the Nth highest employee salary from an Employee table in MySql. This tutorial was exactly what my giantic sql-db needed. Leave A Reply Cancel Reply. Save my name, email, and website in this browser for the next time I comment. By Vikas Kumar Last updated Jan 20, Vikas Kumar.

How to import SQL file to MySQL using Command Line

You might also like More from author. Pastelka says 2 years ago. Full Stack developer says 2 years ago. Jason says 2 years ago. Its working cool Thank you so much sir. Shubham Mathur says 1 year ago. This is one of the best article in google list. Vikas Kumar says 1 year ago.

import database mysql command line windows xampp

Sally says 1 year ago. Vinod says 12 months ago. Vikas Kumar says 12 months ago. Enes says 5 months ago. I takes a lof of time to import an 8 gb file. Do you know another way to import it fast? Leave A Reply.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. To access the mysql command in Windows without manually changing directories, do this:.

The reason that you can't see the other tables is that you need to log in as 'root' in order to see them. So, if you installed xampp as is and did not customize any documentroot, serverroot, etc. To access SQL via the command line we simply navigate to the xampp folder. Now you are in.

You can list all available databases, and select one using the fallowing:. If you plan to work a lot in terminal, consider installing an alternative terminal cmd line, I use cmder terminal - Download Page. Learn more. Ask Question. Asked 11 years, 6 months ago. Active 10 months ago. Viewed k times. Nathan Long. Nathan Long Nathan Long k 89 89 gold badges silver badges bronze badges.

Active Oldest Votes. Log into your mysql server, and start typing your commands. Hope it helps Wadih M. That helped a lot. Also thanks for the comment about mysqldump - I was under the mistaken impression you access it from the mysql command line instead of the windows command line.

Stewart Jan 5 '17 at I had to use. Dean Peters Dean Peters 1 1 gold badge 8 8 silver badges 9 9 bronze badges. DAMO 3 2 2 bronze badges. System Properties will appear. Click on the 'Advanced' tab. Click 'Environment Variables'. Under System Variables, locate 'Path' and click Edit.

Waldhorn Waldhorn 4 4 silver badges 6 6 bronze badges. That works.

Subscribe to RSS

Click Shell. I found this solution is perfect for Xampp. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time.

Disable with --disable-auto-rehash. Defaults to on; use --skip-auto-rehash to disable. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Also, I just wrote a more detailed answer to another question on MySQL imports, if this is what you're after.

You may also need to specify the host. From your statement, it looks like you run on Windows. Try this:. I think the commands are OK, issue is with the spaces. Please observe the spaces between -u and myusername also between -p and mypasswd. Also, you need not add -p and the time of command, if your password is blank, it will not ask you for the password. If you have password to your database, it will ask for the password. I think the OP's problem was not escaping the slashes.

Learn more. Asked 9 years, 4 months ago. Active 2 months ago. Viewed k times. Daniel Hilgarth k 35 35 gold badges silver badges bronze badges. Mamadou Mamadou 1, 5 5 gold badges 30 30 silver badges 41 41 bronze badges. Active Oldest Votes. I use the command above, substituting my own user and password and file name, and I get this output:mysql Ver Just a clarification: this needs to be done in the windows cmd prompt. Didn't work for me in Git Bash prompt. Tip for big imports that take a long while: During the import process you can refresh your phpmyadmin site and see if tables are created.

Andreas Krueger Andreas Krueger 1, 13 13 silver badges 15 15 bronze badges. Ok, tx. I have now access denied problem. I can access some DBs and not the one i created via phpmyadmin.

I put all privileges for a user. You can't 'switch to root', once you're logged on. There's nothing like a 'su' or 'sudo' command as in Unix. You need to log on as root right away: - mysql -u root -h localhost If password is blank no need to add the -p args.

Different ways to import database using command line in MySQL ?

Shonubi Korede Shonubi Korede 2 2 silver badges 4 4 bronze badges. Ratikanta Sahoo Ratikanta Sahoo 21 3 3 bronze badges.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Also, I just wrote a more detailed answer to another question on MySQL imports, if this is what you're after.

You may also need to specify the host. From your statement, it looks like you run on Windows. Try this:. I think the commands are OK, issue is with the spaces. Please observe the spaces between -u and myusername also between -p and mypasswd. Also, you need not add -p and the time of command, if your password is blank, it will not ask you for the password. If you have password to your database, it will ask for the password.

I think the OP's problem was not escaping the slashes. Learn more. Asked 9 years, 4 months ago. Active 2 months ago. Viewed k times. Daniel Hilgarth k 35 35 gold badges silver badges bronze badges. Mamadou Mamadou 1, 5 5 gold badges 30 30 silver badges 41 41 bronze badges. Active Oldest Votes. I use the command above, substituting my own user and password and file name, and I get this output:mysql Ver Just a clarification: this needs to be done in the windows cmd prompt.

Didn't work for me in Git Bash prompt. Tip for big imports that take a long while: During the import process you can refresh your phpmyadmin site and see if tables are created. Andreas Krueger Andreas Krueger 1, 13 13 silver badges 15 15 bronze badges. Ok, tx. I have now access denied problem.

I can access some DBs and not the one i created via phpmyadmin. I put all privileges for a user. You can't 'switch to root', once you're logged on. There's nothing like a 'su' or 'sudo' command as in Unix.

You need to log on as root right away: - mysql -u root -h localhost If password is blank no need to add the -p args. Shonubi Korede Shonubi Korede 2 2 silver badges 4 4 bronze badges.

Ratikanta Sahoo Ratikanta Sahoo 21 3 3 bronze badges. Please only add new answers to a question. This answer has been posted many times in this thread and does not add anything to it. This is actually the first correct answer for Linux on the page!We will certainly go to Nordic Visitor when we do.

mysql -h localhost -u root

Thank you again for all the thoughtful planning that made this trip truly memorable. Everything was extremely well done, I though. Sigfus was very accomodating when it came to answering every question--he even answered my question when he was out of the office sick.

The entire self-drive course along the Ring Road was easy to follow. I mostly used the GPS, but the maps and atlas came in handy when trying to find locations the GPS did not recognize as well as letting me find other desinations of personal interest (like the gliderport just outside of Reykjavik). Nordic Visitor impressed us from the start with instant replies to Emails and the ability to call Nordic Visitor using a 1800 number from Australia, as I did once, was great.

I have to thank Helena for everything she did for us, including sorting the slight hiccup that occurred in our pickup from Oslo airport. The documentation presented to us was 1st class, maps, travel information, and we much appreciated the DVDs from Hurtigruten.

We loved everywhere we travelled, Trondheim, cruising the Fjords, Bergin, perhaps Flam was a highlight, getting there, the accommodation, the included meal, the train ride. As it turned out we did the train from Flam to Myrdal twice as the train to Oslo could not operate due to snow, so they sent us back to Flam and then a bus to Oslo. Many thanks to Nordic Visitor and Helena, maybe Iceland is next. Your staff was very helpful setting up the trip with our special requests and making sure things were right while we were on the trip.

Our primary purpose for the trip was to see and photograph the Northern Lights, which we were able to do 2 lovely nights in a row. But the entire trip was great -- Iceland and its people are wonderful and we definitely want to return. We have traveled independently many times but with a short stay of one week decided that going through a travel company would help us make best use of our time- and the ability to do a 'facilitated' self guided tour was perfect for us.

We all agreed it was the best short break holiday we have ever had THANK YOU!. The information package was so good that a meeting with my travel agent was not required. The map was so detailed we rarely needed anything else. All sites were thoughtfully laid out and were excellent. The package could not have been better. Hotels were all excellent and meals they provided were well above expectations.

We had a wonderful experience. Alexandra was such a pleasure to work with and helped us book a wonderful stay. We loved the welcome package--the map was so helpful with all of the highlighting of where we'd be staying, what route we'd take, and the sites we could see along the way.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *