Use source to import large .sql files

Its true, don’t waste your time with strange scripts and such if you’re trying to upload an .sql file that exceeds the limit. Just give up and use source. Note: don’t be confused that I don’t capitalise my MySQL commands. Its my silent protest against standard MySQL syntax: I think capitalising commands you have to type over and over is dumb. SOURCE is the same as source.

  1. Upload the .sql file to your server somewhere, preferably with lftp
  2. ssh to your server: $ ssh username@username.hostname.com
  3. Start mysql: $ mysql -u username -p password
  4. Find the correct table: $ show databases;
  5. Access the database you want to import to: $ use databasename;
  6. And finally the source command: $ source path/to/filename.sql

I used several sources for this, but John Andrews was the angriest.

This entry was posted in Solutions. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>