Welcome Guest!

If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:

  • Receive Fast Advice
  • Learn Programming Languages
  • Get Professional Website Reviews
  • Quick Troubleshooting Assistance

> Import 100mb+ Sql File

This is a discussion on Import 100mb+ Sql File, within the MySQL section. This forum and the thread "Import 100mb+ Sql File" are both part of the Programming Your Website category.

 
Reply to this topicStart new topic
> Import 100mb+ Sql File
Jason
post Aug 19 2008, 05:10 AM
Post #1


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


So I am working with a forum and I need to do some work on it. However the Database is 100MB+ The download is still going! And its compressed!!!

Is there a tool to upload this in one go? phpMyAdmin looks at the file and faints. How do you import huge SQL files?


--------------------
Go to the top of the page
 
+Quote Post
c010depunkk
post Aug 19 2008, 06:15 AM
Post #2


Rapid Squeezer
Group Icon

Posts: 199
Joined: 14-February 08
From: Willich, Germany


Try dividing them into smaller sections....


--------------------
www.c010depunkk.com ~ the hangout of a web developer
Go to the top of the page
 
+Quote Post
Jason
post Aug 19 2008, 06:44 AM
Post #3


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


QUOTE (c010depunkk @ Aug 19 2008, 12:15 PM) *
Try dividing them into smaller sections....


My text editor can't handle it. Painfully slow. Program randomly crashes.

I can download each table separately but that doesn't avoid the 70MB+ posts table.

With so many popular forums and websites around I would have thought that this would be a common problem with a relatively simple solution.


--------------------
Go to the top of the page
 
+Quote Post
Rakuli
post Aug 19 2008, 07:09 AM
Post #4


Squeeze Machine
Group Icon

Posts: 766
Joined: 13-February 08
From: Catching the squeezed drips downunder.


phpMyAdmin can't handle it because of upload limits. You need to run mysql from the command line.

Open a terminal (if you're locally doing it) or ssh into your server -- most allow this. If you're on windows you will need to download win ssh client. Open command line and

CODE
ssh username@domain.com


You will then be promted for you ssh password, enter it.

Then mysql

CODE
mysql -u mysqlusername -p


Then input your mysql password, that will log you into the mysql command line.

Then

CODE
source /home/path/to/sql.sql


--------------------
Luke Dingle . com

Turn Over a Playful Leaf on Web Design -- read about the javascript cat
Go to the top of the page
 
+Quote Post
Jason
post Aug 19 2008, 07:12 AM
Post #5


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


QUOTE (Rakuli @ Aug 19 2008, 01:09 PM) *
phpMyAdmin can't handle it because of upload limits. You need to run mysql from the command line.

Open a terminal (if you're locally doing it) or ssh into your server -- most allow this. If you're on windows you will need to download win ssh client. Open command line and

CODE
ssh username@domain.com


You will then be promted for you ssh password, enter it.

Then mysql

CODE
mysql -u mysqlusername -p


Then input your mysql password, that will log you into the mysql command line.

Then

CODE
source /home/path/to/sql.sql


Ah interesting. I have only used the terminal when using ruby on rails. I will investigate it.


--------------------
Go to the top of the page
 
+Quote Post
c010depunkk
post Aug 19 2008, 08:39 AM
Post #6


Rapid Squeezer
Group Icon

Posts: 199
Joined: 14-February 08
From: Willich, Germany


use notepad++ if you need to open the files... I've opened 25GB text files with it before....


--------------------
www.c010depunkk.com ~ the hangout of a web developer
Go to the top of the page
 
+Quote Post
Jason
post Aug 20 2008, 06:24 AM
Post #7


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


Meh, i'm stuck.

I have XAMPP. I am using the sql console tool it comes with. I would be done. However I cannot connect as a user.

QUOTE
mysql> \r
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'design'


These are my options.
QUOTE
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear command.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.
edit (\e) Edit command with $EDITOR.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
nopager (\n) Disable pager, print to stdout.
notee (\t) Don't write into outfile.
pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
system (\!) Execute a system shell command.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

mysql> help contents
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> is one of the following
categories:
Account Management
Administration
Data Definition
Data Manipulation
Data Types
Functions
Functions and Modifiers for Use with GROUP BY
Geographic Features
Language Structure
Storage Engines
Stored Routines
Table Maintenance
Transactions
Triggers


Any ideas on how I authenticate myself. I have tried a couple of things but none have worked.


--------------------
Go to the top of the page
 
+Quote Post
Rakuli
post Aug 20 2008, 07:42 AM
Post #8


Squeeze Machine
Group Icon

Posts: 766
Joined: 13-February 08
From: Catching the squeezed drips downunder.


If you're using xamp, you should be able to use windows command prompt

Open and type

mysql -u username (probably root) -p

Then you will be prompted for your password.

Based on the above, you are connecting as an anonymous user and have no rights. If you didn't set a password on install try either password or nothing


--------------------
Luke Dingle . com

Turn Over a Playful Leaf on Web Design -- read about the javascript cat
Go to the top of the page
 
+Quote Post
Jason
post Aug 20 2008, 07:56 AM
Post #9


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


QUOTE (Rakuli @ Aug 20 2008, 01:42 PM) *
If you're using xamp, you should be able to use windows command prompt

Open and type

mysql -u username (probably root) -p

Then you will be prompted for your password.

Based on the above, you are connecting as an anonymous user and have no rights. If you didn't set a password on install try either password or nothing


I'm using a mac, every command works, I just need authentication. I have tried to use the terminal and run the command specified but it says the mysql command doesn't exist.


--------------------
Go to the top of the page
 
+Quote Post
Jason
post Aug 20 2008, 08:10 AM
Post #10


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


Fixed. You need to start the command with ./

A minor thing but apparently very important. Thanks for the help. With the command above starting with ./ it worked perfectly.


--------------------
Go to the top of the page
 
+Quote Post
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   1 edd 227 27th March 2008 - 01:33 PM
Last post by: edd
No new   17 thewal 538 19th June 2008 - 01:19 AM
Last post by: Fancy
No New Posts   3 mcdanielnc89 283 9th June 2008 - 03:15 PM
Last post by: mcdanielnc89
No New Posts   6 MikeHopley 905 15th August 2008 - 10:54 AM
Last post by: MikeHopley
No new   14 MikeHopley 1,225 23rd September 2008 - 04:45 PM
Last post by: MikeHopley