Forum Moderators: coopster

Message Too Old, No Replies

Trouble Uploading Datafiles Into MySQL

         

deeanne59

7:35 pm on Jul 24, 2004 (gmt 0)

10+ Year Member



Hello everyone. I have been trying for 2 days to get my data loaded into my local mysql server...to no avail. I have tried using the "Insert..." link at the bottom of PHPMyAdmin- but it returns a "lbi.check.php: missing database" and lbi.check.php: .missing table" error message. When I type in the "LOAD DATA INFILE..." command at the prompt, it either continues to give me syntax errors...or it tells me that my file cannot be found. I have a copy of the file in the same directory as mysql, and also in my database folder...but it cannot find it.

I have tried this as both "LOAD DATA INFILE", and "LOAD DATA LOCAL INFILE...". This is starting to drive me crazy! :p

coopster

1:18 pm on Jul 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't use phpMyAdmin, but from those two errors it seems you either aren't connecting to the MySQL server yet, or have not selected a database upon connection. Have you double checked your host, userid, pwd, and database variables/constants yet?

deeanne59

5:21 pm on Jul 28, 2004 (gmt 0)

10+ Year Member



Hello Coopster....I have tried connecting to MySQL, and it enters me into the "MySQL Monitor" with the mysql prompt....so I assumed I was logged into MySQL. Is there another way to tell if you are connected? I tried doing this from EasyPHP, but it sets up your directory differently, and it gets confusing. Are you strictly using the command line, and skipping phpmyadmin? If I can understand the way it is set up...I am thinking of retrying EasyPHP.

Using the full programs on my computer is getting complicated. Since I am new to all this - it is like trying to walk in a minefield blindfolded. :)

I hope someday to get this PHP thing down pat, but it has a steep learning curve for me.

coopster

6:03 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Yes, I use the command line quite often during testing and find it quite handy for initial file loading from spreadsheet files saved as tab-demilited text. For scripted batch file loads, I invoke the LOAD DATA INFILE statement.

mysql -u userid -p databasename < spreadsheet.sql


spreadsheet.sql
DROP TABLE IF EXISTS testtable; 
CREATE TABLE testtable (column1 CHAR(50));
LOAD DATA LOCAL INFILE '/path/spreadsheet.txt' INTO TABLE testtable;


spreadsheet.txt
Row1 
Row2
Row3