The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
update mysql with text file from phpmyAdmin
Discuss update mysql with text file from phpmyAdmin in the PHP Development forum on Dev Shed. update mysql with text file from phpmyAdmin PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 9th, 2000, 12:30 PM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 23
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
hey, all... I'm having a bit of a problem, in that I have a text document (update.txt) on my local drive, and while using phpmyadmin, I need to update the nec. tables.
I keeping getting an error with phpmyadmin that states:
'Error
MySQL said: File 'php2' not found (Errcode: 2)'
I don't know what this error is, and I really need the ability to remotely update the databse... I'm running mysql and php on a backoffice server. right now I go to the server and use:
mysql DBNAME < TABLENAME.txt
to import the data... Soon, I will need to do this remotely... Please let me hear your ideas as to the strange error message. Perhaps I'm using phpmyadmin incorrectly?
Thanks!
rainmaker
------------------
Everyone want's to be a rock star.... I just want the money.
|

May 9th, 2000, 12:38 PM
|
|
Apprentice Deity
|
|
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237

Time spent in forums: 4 m 8 sec
Reputation Power: 17
|
|
|
phpMyAdmin, AFAIK, does not support uploading a local schema file to the remote db. The only way you could do this via MyAdmin is to copy and paste the contents of the file to the "Run SQL query/queries..." text box.
You could also do this the traditional way and upload the file to the server and use the command line.
|

May 9th, 2000, 02:16 PM
|
|
Junior Member
|
|
Join Date: May 2000
Posts: 23
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PHPmyAdmin specifically has an option entitled: Insert textfiles into table
My text file looks like:
********************************************
INSERT INTO phone_table
VALUES (
NULL,
2,
'Jones',
'John',
'Micro Spec.',
'jones@texasU.edu',
'443-4567',
'443-4448',
'443-3456',
NULL );
********************************************
When you select this option, you are asked to fulfill these options:
Location of text file:
Fields terminated by:
Fields enclosed by:
Fields escaped by:
Lines terminated by:
as well as a few others that are yes/no questions.
I would be fine with uploading and doing it from the command line, however, I can't telnet to this box; so that, I can't do.
Besides, updating tables via a text doc and a browser is something I would like to know how to do. I was planning on getting this to work, then view the phpmyadmin source and insert it into my own, custom project.
Thanks for everyone's replies.
rainmaker
------------------
Everyone want's to be a rock star.... I just want the money.
|

May 10th, 2000, 10:58 AM
|
|
Gödelian monster
|
|
Join Date: Jul 1999
Location: Central Florida, USA
|
|
|
rainmaker-
It looks to me like there is not a problem with MySQL or phpMyAdmin, but rather with the file upload configuration of your webserver. In order for phpMyAdmin to allow you to browse your local drive and choose a file for MySQL, the web server has to then save that file to a temporary location, which MySQL then reads. (thus the 'File not found' message)
Check up on how IIS4 supports the File Upload form element. (I am more familiar with Apache, sorry)
Also, this might simply be a bug with phpMyAdmin/NT. phpMyAdmin was originally written with Unix in mind, and it might have a problem with the Windows '' directory naming convention. (notice the 'php2' in the error message) You might check for the latest version of phpMyAdmin, or ask the creators if this is a bug.
Good luck
|

May 10th, 2000, 04:22 PM
|
|
Contributing User
|
|
Join Date: Mar 2000
Posts: 60
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
I think you mut be using this on Win32. I have the same issue on three installs on Win32 (98/NT), but it works fine on Linux. phpMyAdmin was definitely written for 'nixes. Also, there are some issues with PHP4RC1/RC2 and phpMyAdmin 2.0.5. return statements from a "require()" need to be changed to "include()".
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|