MySQL: ERROR 1045 (28000): Access denied for user 'joannagriffiths'@'localhost' (using password: NO)

1,127 views
Skip to first unread message

Joanna Griffiths

unread,
Dec 9, 2016, 1:06:35 PM12/9/16
to Stacks

Hi everyone, 
I have been trying to get MySQL to run from the load_radtags.pl script with no success. I have edited all these files to contain the correct usernames and passwords:
/usr/local/share/stacks/sql/mysql.cnf
/usr/local/share/stacks/php/constants.php

I can log in to MySQL just fine by doing: "mysql -u joannagriffiths -p" and then entering the same passwords, but I am sure why I am getting the following error codes when running with this script: 
load_radtags.pl -D unc_rxstacks_radtags -b 1 -p ./stacks/ -B -e "Uncorrected data" -c

ERROR 1045 (28000): Access denied for user 'joannagriffiths'@'localhost' (using password: NO)

The output of errors is much longer but I think this might be the key problem.

Any help anyone can provide would be greatly appreciated!

Thank you!
Joanna

Julian Catchen

unread,
Dec 9, 2016, 2:44:08 PM12/9/16
to stacks...@googlegroups.com, joanna.g...@gmail.com
Hi Joanna,

Do you have a MySQL config file in your home directory? The Stacks
programs will first look for this file and they use it if it is there.
It would be called, ~/.my.cnf

If you do have this file, does it have the correct credentials in it?
When you run load_radtags.pl it complains that you are not supplying a
password, so does this file not have a password in it?

If you don't have a file in your home directory, the Stacks programs
fall back to the one you installed with Stacks, in
/usr/local/share/stacks/sql/mysql.cnf.

You can test the credentials in this file directly by running:

mysql --defaults-file=/usr/local/share/stacks/sql/mysql.cnf

julian

Joanna Griffiths

unread,
Dec 9, 2016, 5:26:42 PM12/9/16
to Julian Catchen, stacks...@googlegroups.com
Hi Julian, 
Thank you for your reply.
I do not think I had the ~/.my.cnf file
I tried running mysql --defaults-file=/usr/local/share/stacks/sql/mysql.cnf 
but got the same error output: ERROR 1045 (28000): Access denied for user 'joannagriffiths'@'localhost' (using password: NO)
However, I created the ~/.my.cnf and added the same credentials as in /usr/local/share/stacks/sql/mysql.cnf
It seems to be working now!

Thank you!!

--
Joanna Griffiths
PhD Student
https://joannasgriffiths.wordpress.com/
Kelly lab and Hellberg lab
Department of Biological Sciences
Louisiana State University
Reply all
Reply to author
Forward
0 new messages