Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Importing large sql files in mysql from the server

Posted on 2007-04-01
9
Medium Priority
?
623 Views
Last Modified: 2013-12-12
I always have problems loading large files into phpmyadmin, is there a program that I can drop into a folder and choose a .sql file to import into a mysql database?
I am using a php/mysql.
The sql files can go up to 30 megs.

0
Comment
Question by:CrazyPhil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 500 total points
ID: 18833728
hi - if you use a free program called sqlyog (http://www.webyog.com) you can do this, but you can also do it if you have access to the command line mysql client - you can just specify the file to run something like

mysql -u userName -pYourPassword <  yourSqlFile.sql
0
 

Author Comment

by:CrazyPhil
ID: 18833749
Unfortunately I cannot use that program, though it does look useful. My dbs are only accessible from the internal server not outside of it; though I am switching hosts soon and that may change. Also I don't think I have command line access...though I could be wrong.
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18833791
if all you have access to is the server and running things internally then you have no choice to use whatever tools they have given you - which if this is only phpmyadmin, this is all you can do,

however if you can create php pages you would be able to get them to execute your command line arguements and get around it
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

Author Comment

by:CrazyPhil
ID: 18833854
So a simple;

mysql_query('mysql -u userName -pYourPassword <  yourSqlFile.sql');

Would work? where would I place the sql file?
0
 
LVL 19

Assisted Solution

by:Kim Ryan
Kim Ryan earned 500 total points
ID: 18834256
I don't think that wiuld work. You need to start mysql program from a command line, so you need some type of terminal (shell) access to the server. You can palce .sql file anywhere on the server but need to specify the full path to it, if this is not the same directory you are running mysql from.
0
 
LVL 35

Expert Comment

by:Raynard7
ID: 18834314
no - mysql_query would not work in this case, you would need to use shell_exec and then those commands, you would have to place the sql file on your server, which you may or may not have permissions to do
0
 

Author Comment

by:CrazyPhil
ID: 19097722
I have resolved this, I switched to a better host, surprisingly this made a difference.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question