Opening a large .SQL file.

Results 1 to 12 of 12
  1. #1
    Account Upgraded | Title Enabled! Cancel Man is offline
    MemberRank
    Nov 2008 Join Date
    Canberra, ACTLocation
    203Posts

    Opening a large .SQL file.

    I've got a .SQL file that is 2.11GB (2,271,290,797 bytes), and im having so much trouble opening it, firstly i tried phpmyadmin, which should be associated with SQL files, it said the file was too large, then i tried opening it with Microsoft Notepad, still too large i wasn't expecting much with it being Microsoft and all. Then i tried Notepad++ which has always been reliable to me, still too large. How would one open this file? I've done quick google but nothings come up.
    Thanks for any help in advance.


  2. #2
    WHOOOOOO yjlasher22 is offline
    MemberRank
    May 2008 Join Date
    SingsongpoLocation
    1,249Posts

    Re: Opening a large .SQL file.

    weird... a quick google came up with dozen of solutions for this. most of it requires you buy stuff, but here's one i found.

    Quote Originally Posted by http://forums.digitalpoint.com/showthread.php?t=29601
    With linux shell (over ssh for example) you can easilly chop it in pieces with for example following command:

    Lets assume your sql file is example.sql. With this command the sql file will be choped to 50m pieces. CD to the directory where the sql file is located and execute following command:

    split -b 50m example.sql example_

    You will get files example_aa , example_ab and so on.

    now you can open any of those files, edit and save. When you are done you can combine those files with a command like for example:

    cat example_[aa-bb] > example.sql

  3. #3
    Account Upgraded | Title Enabled! Cancel Man is offline
    MemberRank
    Nov 2008 Join Date
    Canberra, ACTLocation
    203Posts

    Re: Opening a large .SQL file.

    Um, i'll try that once i get back on my desktop. But can i use a Linux shell code in Vista?
    I'd rather not "buy" one as i'm trying to keep this computer as legit as possible. And if i was to split each file to say 100mb each wouldn't that mean for me to be able to read the end result i'd need to c+p each into a new file? How can it read that but not open it?
    I'm not exactly very tech savvy ;)

  4. #4
    Omega Ron is offline
    MemberRank
    Apr 2005 Join Date
    Location
    8,990Posts

    Re: Opening a large .SQL file.

    Just wait for it to load everything?

    2.1 gb of text is a lot of text... It needs a while to load.

  5. #5
    The next don TheAJ is offline
    DeveloperRank
    May 2007 Join Date
    Toronto, CanadaLocation
    3,946Posts

    Re: Opening a large .SQL file.

    If you have access to editing php.ini, change the upload size limit to 2.1gb then later change it back after you execute the sql file, which will most likely take hours - days

    Or you can use Navicat, it doesn't load the whole file at once, it loads while it executes, took me 15 minutes or so to execute 10mb of sql data from navicat, on a quadcore, 6gb ram. Sadly navicat doesn't support multicores so more likely if you have a quadcore or a dualcore your cpu will be stuck at 25% (quad) or 50% (dual)
    Last edited by TheAJ; 03-08-09 at 10:37 AM. Reason: spelling error

  6. #6
    Account Upgraded | Title Enabled! KidFlow is offline
    MemberRank
    Oct 2008 Join Date
    Above the skyLocation
    1,257Posts

    Re: Opening a large .SQL file.

    I tried opening 100MB + .SQL and I crashed. Wow good luck aswell.

  7. #7
    Alpha Member Anujan is offline
    MemberRank
    May 2008 Join Date
    Ontario, CanadaLocation
    1,633Posts

    Re: Opening a large .SQL file.

    Quote Originally Posted by TheAJ View Post
    If you have access to editing php.ini, change the upload size limit to 2.1gb then later change it back after you execute the sql file, which will most likely take hours - days

    Or you can use Navicat, it doesn't load the whole file at once, it loads while it executes, took me 15 minutes or so to execute 10mb of sql data from navicat, on a quadcore, 6gb ram. Sadly navicat does support multicores so more likely if you have a quadcore or a dualcore your cpu will be stuck at 25% (quad) or 50% (dual)
    Interesting...
    Never knew that.
    Splitting the file would be your best option.

  8. #8
    WHOOOOOO yjlasher22 is offline
    MemberRank
    May 2008 Join Date
    SingsongpoLocation
    1,249Posts

    Re: Opening a large .SQL file.

    Quote Originally Posted by Cancel Man View Post
    Um, i'll try that once i get back on my desktop. But can i use a Linux shell code in Vista?
    I'd rather not "buy" one as i'm trying to keep this computer as legit as possible. And if i was to split each file to say 100mb each wouldn't that mean for me to be able to read the end result i'd need to c+p each into a new file? How can it read that but not open it?
    I'm not exactly very tech savvy ;)
    no... you would not be able to use the linux shell in windows, unless you get virtual... whats that word, nah, emulator like... virtualbox? however, i do believe that you would be able to open the split files in windows.

  9. #9
    Novice khubab1 is offline
    MemberRank
    Aug 2009 Join Date
    1Posts

    Re: Opening a large .SQL file.

    Hi, Kindly read very usefull article for huge sql data uploading at http://www.nobleatom.com

  10. #10
    The Cat in the Hat cypher is offline
    MemberRank
    Oct 2005 Join Date
    IrelandLocation
    5,073Posts

    Re: Opening a large .SQL file.

    neah just use the command line:

    1. go to run
    2. type mysql -u root -p (if it`s added on path variable, if not you`ll need to specify complete path to the executable)
    3. enter your password
    4. use (database name here, if you didn`t create it yet type: create database db_name_here;)
    5. type source (path to your .sql file, example c:\a.sql)

  11. #11
    space omen is offline
    MemberRank
    Aug 2003 Join Date
    LondonLocation
    1,088Posts

    Re: Opening a large .SQL file.

    if cyphers suggestion doesnt work - which can happen.

    Code:
    mysql -u root -p -h localhost databasename < C:\larger-sql-file.sql
    mysql = mysql command, for linux it should work just in shell if your shell has loaded variables. Windows you would need to cd to where mysql.exe is.

    -u = username flag
    root = your root username
    -p = password flag
    -h = hostname flag
    localhost = the host that has mysql running
    databasename = database name
    < = import
    C:\larger-sql-file.sql = your file, this would be different in linux.

    this command should prompt you for your root's password

    depending on your ram, cpu, mysql allocated ram and optimizations it will take some time.
    Last edited by omen; 30-08-09 at 05:18 AM.

  12. #12
    Account Upgraded | Title Enabled! lewis-smiffy is offline
    MemberRank
    Aug 2007 Join Date
    Perv much ?Location
    417Posts

    Re: Opening a large .SQL file.

    Use big dump, that's how I dumped the db of my forum.



Advertisement