Hi,
This is a two part request.
Part 1:
I have an Excel spreadsheet almost 44,000 rows long, but I have been
unable to get it to put the information into my phpMyAdmin SQL type of
database. When I use this script:
LOAD DATA INFILE "C:/sample1.csv" INTO TABLE products FIELDS
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY "\n";
I get this error:
MySQL said:
#1045 - Access denied for user: 'bcwqbb302974@26.785.415.6' (Using password: YES)
(actual numbers changed here for security)
However, when I use this proceedure I get the following syntax error.
I use either a .csv file created by Excel save as or a file created
in my editor. I've tried comma delimited and tab delimited files with
careful attention to var types. At this point I use just a one row
file because I'm trying to eliminate error possibilities, but I don't
know what else to do at this point. The access denied error only
comes up when using the above script, but when I use this procedure:
double click the "products" link in the left hand margin to bring up
the products table, click the "Query window" link in the left hand
margin, then click the "import files" tab, then do "browse", click
"autodetect", then click "go", then the syntax error comes up (but not
the access denied error). I've circumvented the script "access error"
with the procedure stated in this paragraph, but there seems to be
some syntax error I can't figure out. Where could the syntax error be
coming from?
MySQL said:
#1064 - You have an error in your SQL syntax near 'b2, c3, d4, e5, f6,
h7, i8, j9' at line 1
I'm not a programmer, so you will need to tell me what information you
will need to answer this question and how to get that information.
So what I'm looking for is either a script that does not give an
access error (and no syntax error when access is allowed) or an
explanation of how I transfer my data without syntax errors using the
click commands of phpMyAdmin.
Part 2:
There is another simple script I'd like to execute that will allow me
to do a complete mirror copy for back-up of my web site to another
url. Because I have a slow dial-up connection, and the products
database is so large and growing, and there are so many web pages and
a growing customer database, I'd prefer to simply do the copy-back-up
from one url server to another automatically and at high-speed. To
ftp the copy as a backup to my pc is not practical. Ideally I will
just have 10 to 15 directories in my other url and each time I execute
the backup it will copy it into the next consecutive directory. That
way if I do it once a day, I will have 2 weeks worth of back-ups. If
I don't catch a corruption for a couple of days, I still have a
previous good back-up I can restore from.
I have php and cgi-bin available to me at both sites. For a quick
answer with working code, I will include a $25 tip.
Thank you for your help in this.
Steve |
Clarification of Question by
stevep234-ga
on
16 Nov 2003 13:57 PST
I meant to say "I'm not a programmer, so you will need to tell me what
information you need me to get for you to answer these questions and
the procedure of how I can get that information for you".
Thanks
|
Request for Question Clarification by
mathtalk-ga
on
16 Nov 2003 15:11 PST
Hi, Steve:
Let's start with some suggestions on the first part, trying to upload
a .CSV (comma-separated-value) file into MySQL.
The error messages you report sound like two distinct problems, but
sometimes there's only one problem and it justs appears with two
symptoms.
The first error message makes it sound like there's a "permissions"
problem, e.g. that the user account corresponding to the credentials
described don't have insert permission on the underlying table. It
might be worth trying attaching to the database in another way, just
to verify the validity and privilege level of the user credentials
used here. However you say you aren't a programmer, so if you don't
know another way to talk to the database directly with that account,
let's set that issue aside for the moment.
Now let's consider the second error message, which certainly sounds
like it's trying to report a syntax error in the file. Probably the
first line of your file contains "column headings" instead of values,
and the column headings (being nonnumeric data) don't make sense for
inserting into the underlying table (whose name seems to be
"products").
So I'd like you to do these experiments:
1) Look at the first line of your .CSV file to verify if it differs
from the rest of the file (by consisting of column headings, rather
than numbers).
2) Assuming that's the case, then build a smaller test file, say only
50 rows long, and remove the first line (thereby omitting the column
headings).
If you need help performing these tasks, let me know what "text
editor" if any you are familiar with, and the platform (PC/Unix/Mac)
that you are most comfortable with.
thanks, mathtalk-ga
|
Clarification of Question by
stevep234-ga
on
16 Nov 2003 16:03 PST
hi, and thank you!
I can insert information manually using the phpMyAdmin interface.
The table is complete and I'm sure the var values are set properly.
My actual Excel spreadsheet is 28 columns by 43,890 rows, so first I
tried a sample of 25 rows, but that did not work, so I've made a test
"sample" database of only one row long, saved it in both comma and tab
delimited formats, double checked with my editor but still got the
same errors - access denied with a script, or syntax error when using
their click commands. I'm using Windows 98SE, I can use an editor ok,
and I think I know enough about Excel, but don't take any of my
knowledge for granted, as I really only know vague theory about
databases, and not the "nuts and bolts" of them.
Did that help to clarify any?
Let me know, and thank you.
Steve
|
Clarification of Question by
stevep234-ga
on
16 Nov 2003 16:05 PST
The text editor I use is called "Edit Pad Lite".
|
Clarification of Question by
stevep234-ga
on
16 Nov 2003 16:13 PST
hi,
Did you unlock the question because you gave up?
Steve
|
Clarification of Question by
stevep234-ga
on
16 Nov 2003 16:17 PST
these are the fields in my "products" table:
INSERT INTO `products` ( `id` , `partNumber` , `supplierID` ,
`category` , `manufacturer` , `model` , `subCategory` , `itemUse` ,
`color` , `description` , `listPrice` , `ourPrice` , `perQty` ,
`warranty` , `chemistry` , `volts` , `amphours` , `dimensions` ,
`availability` , `picture1` , `picture2` , `product_notes` ,
`product_updated` , `ship_weight` , `my_cost` , `other_costs` ,
`private_notes` , `BBmodel` , `BBmanufacturer` , `BBcategory` ,
`spare1` , `spare2` , `spare3` )
The "id" field is set to auto increment and the "product_updated" is
auto time/date stamp. What do I do with those fields in the data file
- skip them or leave them there as an empty cell?
Steve
|
Request for Question Clarification by
dewolfe001-ga
on
16 Nov 2003 16:20 PST
As to part 1:
1) There may be a problem with the CSV file itself. I've seen
phpMyAdmin choke on otherwise ideal CSV files. Can you post the first
few lines of the CSV file to your website or as an answer
clarification?
2) Are you using the web browser based phpMyAdmin tools?
3) Has your ISP limited your capabilities with phpMyAdmin? Namely,
have they disallowed file uploads and imports?
Part 2:
There are ways to zip the whole site and DB and send it to another
URL, but what sort of site would you send it to? (e.g. Linux vs.
Windows; size allowance; does it have a regular FTP set-up or use
something like secure shell, etc..)?
Would you want to keep multiple versions of your site? In other words,
a version from this month AND a last month?
|
Clarification of Question by
stevep234-ga
on
16 Nov 2003 17:04 PST
hi,
The Part 1 of this question just became irrelevant. After 3 days my
webmaster just got some kind of a script to work to load the data
information into my database. Of course my offer here still stands of
$50 plus $25 tip for a working script for this question Part 2.
I do have full ftp access to both sites, and both sites have php. The
second site, at just a few dollars a month, I feel may make for a nice
place to back-up to as I only have dial-up available to me.
Yes, I'd like to keep multiple copies of my site. I was thinking
perhaps 15, that way I would always have 2 weeks worth (at one auto
copy/backup per day). I can always do an ftp copy from time to time
to my pc when I want to permanently save. The script could just loop
through to the next url subdirectory on the next save, and after 15
times, start over at the first subdirectory again and overwrite
whatever is there.
I especially want a simple way to restore a web page or customer
database, etc if ever its needed. Thats why I was thinking a simple
url to url copy of each web page might be best. Then I can just use
my ftp program if I ever need to restore anything. Simplicity and
reliability and security are the three most important considerations,
along with very economical operation. I am open to any suggestions
you may have on what I'm attempting. How do other people back-up
their web site?
Thanks.
Steve
|
Clarification of Question by
stevep234-ga
on
17 Nov 2003 01:16 PST
FORGET PART 1 OF THIS QUESTION. ONLY PART 2 NOW MATTERS TO ME.
|