Load Data in phpMyAdmin

haxwings

New Member
Messages
8
Reaction score
0
Points
1
Hello All,

I am trying to fill some tables in my database with information from some CSV files. Previously I was doing this with the import option.

I'd like to use the SQL console to speed up the process, but when I try entering the code manually I receive a password error.

The user it lists is just "da_sso_" followed by a random string of letters and numbers, "@localhost" so it is different each time.

I do have a user for this database that has all privilleges enabled, but that doesn't seem to be the user info the system is using.

Additionally, the files I am trying to import are also hosted on my domain. I tried using different file paths, (domains/mydomain/public_html/... or home/public_html/...), but that doesn't seem to change the outcome at all.

Here's my code:
Code:
LOAD DATA INFILE 'public_html/directory/table_info.txt' INTO TABLE `table_name`
FIELDS TERMINATED BY ';' 
ENCLOSED BY '\"' 
ESCAPED BY '\\' 
LINES TERMINATED BY '\n'



Here's the error text:
Code:
#1045 - Access denied for user 'da_sso_123abc'@'localhost' (using password: YES)



Any help you can give is appreciated. I tried searching online, but could only find information regarding to people running mySQL on their PCs and not from anyone using phpMyAdmin.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
The problem could be the file permissions; I'm not sure what user PHPMyAdmin would be running as in this instance, but it's safe to say that it could possibly not be you and (hopefully) isn't the root user.

If that's the case, then you would have to make everything including your own folder publicly viewable, which would also be bad/not allowed by DirectAdmin.

Is there any way you can upload the file via PHPMyAdmin instead of doing it locally? Go to DirectAdmin->MySQL Databases->PHPMyAdmin->(select the database you want to import)->Import (tab at the top of the page)
 

haxwings

New Member
Messages
8
Reaction score
0
Points
1
Hi Garret, thanks for your reply. I have so far been using the phpMyAdmin import function to upload the information. I have filled 30~ish tables this way already. I was just hoping to be able to do it through the console as it is less time consuming. I have about a hundred more csv files worth of data I need to import, and being about to do multiple at a time would be a great help.

You used the word locally, so I just want to reiterate that I am actually running these commands from inside the myPHPAdmin SQL tab/console and not on any program/command line on my machine. I might be misunderstanding what you meant, but wanted to clarify just in case.

The csv files I have hosted don't have anyt private or sensitive information, so I don't mind making them publicly viewable if you believe that might fix it.

For transparency's sake, the data itself is on popular first names in the USA which the US Social Security Administration makes available for public use. So it is literally free information.

However I don't know how to make the files any more 'public' than I already have by uploading them.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
I'm going to have to take a step back, I think I misread your question. It could be a file permission later on in the sequence, but the error you received was actually a password error, which is exactly what you said.

In DirectAdmin under MySQL Databases, you have the initial page which shows the tables for your account. When you click on the database you can specify the permissions for each individual user. Is your user added to the database with the right permissions (probably at least CREATE, INSERT, UPDATE, and DELETE, but in most cases all permissions are granted since free hosting has limited users). Also make sure that localhost is listed in the ACCESS HOSTS section.

Sorry for misreading your question, I hope this helps.
 

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
in most cases all permissions are granted since free hosting has limited users

i have noticed in times where i create a data base the "grant all" is NOT checked.
ive had to manually check it then save settings.
im not sure if this is a fix or anything i just thought id point that out.
 

haxwings

New Member
Messages
8
Reaction score
0
Points
1
Sorry for the late response. I am trying this now. I was having some sign issues before now.
 

louisocarroll

New Member
Messages
13
Reaction score
0
Points
1
Hello, did anyone get this to work?
I currently upload a file to server with a string that contains an INSERT statement.
But I would like to try to do it with LOAD DATA, since it seems much faster.
Any help would be appreciated!
Thanks!
 
Top