문제

When I try to check the mysql version using terminal I get the following error.

KillBill:~ KillBill$ mysql -v
ERROR 1045 (28000): Access denied for user 'KillBill'@'localhost' (using password: NO)

but when I do the following and add the password it works and logs me into MYSQL prompt.

KillBill:~ KillBill$ mysql -u root -p

Why am I getting the following error on mysql -v prompt only. What do I do to fix it? Everything else is working fine, I can connect to mysql db in the apps I am developing no problem whatsoever.

Any help will be highly appreciated. Thank you!

도움이 되었습니까?

해결책

If you start the mysql client without givinng the -u option, it assumes you want to login with the current username, in your case KillBill. If this user isn't a mysql user or is a mysql user, but has to specify a password to login, the user will be refused a connection.

Login as "root", create a mysql user names "KillBill" and assign a password. Have look here for the syntax of that. Then assign appropriate rights using the GRANT statement.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top