LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Trouble Logging in to mysql (https://www.linuxquestions.org/questions/linux-general-1/trouble-logging-in-to-mysql-187833/)

jevnin 05-30-2004 09:27 PM

Trouble Logging in to mysql
 
I continuously get this error when trying to log in to mysql:

[mythtv@localhost sbin]$ mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

If I leave off the -p, I get a similar error:

[mythtv@localhost sbin]$ mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

I do this after using 'su' to get into my root account. I get the same errors when I actually log in to root. I'm sure the password I'm typing is correct, however the first characher in the password is ')'. Perhaps this is causing the error? Any suggestions? Thanks!

-j

trickykid 05-30-2004 09:34 PM

If this is locally on the same machine try:

mysql -uroot -p<password>

Notice no spaces.

Also did you actually setup a default root password after installing mysql? If you su to root, you can actually connect by just typing:

mysql

You can update the passwords once in mysql that way, etc.

mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'new-password' WITH GRANT OPTION;

And to commit the changes do a:

mysql> FLUSH PRIVILEGES;

I'd suggest creating another user though, not necessarily but I tend to not use root as a user on anything.. just a habit.. ;)

jevnin 05-30-2004 09:43 PM

Thanks for the tips...but:

[mythtv@localhost mythtv]$ mysql -uroot -p)*****
bash: syntax error near unexpected token `)'
[mythtv@localhost mythtv]$ mysql -uroot -p<)*****>
bash: syntax error near unexpected token `)'
[mythtv@localhost mythtv]$ su
Password:
[root@localhost mythtv]# mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
[root@localhost mythtv]# mysql -uroot -p<)evozo4i>
bash: syntax error near unexpected token `)'
[root@localhost mythtv]# mysql -uroot -p<')evozo4i'>
bash: syntax error near unexpected token `newline'
[root@localhost mythtv]# mysql -uroot -p')evozo4i'
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

Frustrated...
-j

trickykid 05-31-2004 12:11 AM

Did you ever setup a default password for root after installation of mysql? And the password is without the <> signs unless its part of your password you initially setup. Is this when your logged into locally to the machine running mysql? Do you also have a ) in your password, since your showing that is the case in the errors your getting?

jevnin 05-31-2004 12:14 AM

yes, i do have an ) in the password I initially defined...
-j

trickykid 05-31-2004 12:19 AM

Quote:

Originally posted by jevnin
yes, i do have an ) in the password I initially defined...
-j

Well it doesn't like it in the syntax, try with single quotes around the password:

mysql -uroot -p'password'

trickykid 05-31-2004 12:23 AM

Please refer to this thread: http://www.linuxquestions.org/questi...hreadid=187769


All times are GMT -5. The time now is 05:19 AM.