Вопрос

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