Re: ERROR 1045: Access denied for user: 'root@localhost' (Using password: yes)
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