Advertisement
ttxnam

Importing large SQL files

May 20th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. *** Importing large SQL files through command line when using PHPMyAdmin/XAMPP
  2.  
  3. 1. First, let us say that my Mysql.exe is in D:\xampp\mysql\bin\mysql.exe (I’m using XAMPP by the way) . I’m gonna put my large SQL file in that directory also, meaning the path for the SQL file will be D:\xampp\htdocs\mycode\sql_file.sql
  4.  
  5. 2. Create your database in your PhpMyAdmin interface(database name only).
  6.  
  7. 3. Run your command prompt(Start -> Run -> then type “cmd”).
  8.  
  9. 4. Type this in the command line, assuming that your MySQL installation and the SQL file locations are on the paths I had given in Step 1.
  10. ---------------------------
  11. D:\xampp\mysql\bin\mysql.exe -u root -p db_name < D:\xampp\htdocs\mycode\sql_file.sql
  12. ---------------------------
  13. where “root” is the username of your database and “db_name” is your database name. After the successful command, you will be asked to enter password, enter your password if it has then press Enter or just press Enter if none.
  14.  
  15. 5. Go back to your PHPMyAdmin to check of the SQL dump file has been executed properly.
  16.  
  17. (http://www.ryantetek.com/2011/09/importing-large-sql-files-through-command-line-when-using-phpmyadminxampp/)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement