MySQL Forums
Forum List  »  Newbie

Re: ERROR 1045: Access denied for user: 'root@localhost' (Using password: yes)
Posted by: Mohsin Jessa
Date: January 12, 2009 05:46PM

What am I doing wrong here?

mysql> load data infile 'c:/from_excel.csv' into table from_excel fields terminated by ',' lines terminated by '\n' ignore 1 lines;

ERROR 1045 (28000): Access denied for user 'mojeeza'@'%' (using password: YES)
mysql> load data infile 'c:\\from_excel.csv' into table from_excel fields terminated by ',' lines terminated by '\n' ignore 1 lines
;
ERROR 1045 (28000): Access denied for user 'mojeeza'@'%' (using password: YES)
mysql> load data infile 'c:\\from_excel.csv' into table 'from_excel' fields terminated by ',' lines terminated by '\n' ignore 1 lin
es;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig
ht syntax to use near ''from_excel' fields terminated by ',' lines terminated by '\n' ignore 1 lines' at line 1
mysql> load data infile 'c:\\from_excel.csv' into table `from_excel` fields terminated by ',' lines terminated by '\n' ignore 1 lin
es;
ERROR 1045 (28000): Access denied for user 'mojeeza'@'%' (using password: YES)
mysql> load data infile 'c:\\from_excel.csv' into table `from_excel` fields terminated by ',' lines terminated by '\n' ignore 1 lin
es;
ERROR 1045 (28000): Access denied for user 'mojeeza'@'%' (using password: YES)



The same user (mojeeza) can insert and select from the table from_excel

mysql> select * from from_excel;
+-------+------------+--------+----------+--------+
| name | dob | gender | donation | member |
+-------+------------+--------+----------+--------+
| Abbas | 1982-12-10 | M | 300 | Y |
+-------+------------+--------+----------+--------+
1 row in set (0.00 sec)

mysql> insert into from_excel values ('Name1',date('2000-01-19'),'F',500,'N');
Query OK, 1 row affected (0.00 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from from_excel;
+-------+------------+--------+----------+--------+
| name | dob | gender | donation | member |
+-------+------------+--------+----------+--------+
| Abbas | 1982-12-10 | M | 300 | Y |
| Name1 | 2000-01-19 | F | 500 | N |
+-------+------------+--------+----------+--------+
2 rows in set (0.02 sec)

The file c:\from_excel.cvs is:

Name,DOB,G,Donation,Member
Mohsin,25-Jan-75,M,1000,Y
Maysam,25-Feb-91,M,0,Y
Arif,20-Mar-80,M,2000,Y
Fatima,01-Dec-60,F,200,N


From query browser, I can perform all dml against the same table from the same user.

I think I have to change the date format in the cvs file or perform date function conversions during the load, but I think I need to fix the access issue first.

Any help will be greatly appreciated.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
November 16, 2005 08:10PM
Re: ERROR 1045: Access denied for user: 'root@localhost' (Using password: yes)
January 12, 2009 05:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.