ERROR 1045, Access denied for user 'root'
I saw other threads that had the same issue, but none of the fixes applied there are seeming to work for me. I have a batch file that is supposed to launch the server but am having issues there. Currently root does not have a password in mysql, I can log in via command window without using one, and if I try using one, it won't work. I have a screenshot of the errors, but since I can't post attachments I will type it up.
Error in DOS window after running batch file to start server Code:
Status Starting Log: logs/eqemu_shared_memory_4560.log My config file has the following: Code:
<database> |
It's a database connection error. You probably have a password on the root account, which must be present there if you do.
Code:
Error Failed to connect to database: Error: #1045: Access denied for user 'root'@'localhost' (using password: YES) |
root password
When I open up a dos command window and go connect to the mysql server
"mysql -u root " this works just fine, but if I try to give it a password it fails. Is there any other way to verify if I have a password on it? I did a query for password column for root user and it returned 3 values (they are just long random strings). |
login to mysql as you did with no root password. type the following, replacing the myrootpw with whatever password you want.
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('myrootpw'); then put the password in your config file. its not worth running without a root pw, even if you make it really simple. give it a try. |
fixed
Thanks man, that got it. Really appreciate the assistance.
|
Where is the config file in question located at? Also the 1045 error message says the password it is trying to use is YES, if I reset the uroot password to YES will it just work?
Respectfully, Ephron |
1) I opened the my.ini file through XAMPP and selected 'config'. I did a ctrl + F for password but none of the matches where on a line that wasn't a comment.
I stopped the sql service and closed XAMPP - no change on restart 2) I clicked on explorer in XAMPP and saw a passwords.txt file in the XAMPP install directory. Top of the file had user: root and password (blank) so I set that to my uroot password. I stopped the sql service and closed XAMPP - no change on restart 3) I read the readme file in the SQL folder but the little I could understand from it didn't seem to be relative to a 1045 error. 4) I checked world.exe's permissions under security and gave everyone full control - no change. I'm going to keep working at it, hopefully I'll find the answer before someone posts it. I mean, database administration isn't too different from domain administration right =P shouldn't be too hard. |
I googled for 'set root password xampp' and found https://www.apachefriends.org/faq_windows.html which explains exactly how to do it.
Don't use 'YES' as your password, that isn't what the error is telling you. |
lerxst2112 the setup guide has you run the command: SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your_pasword'); which worked as I was able to build the database in the later steps.
I can access the database with the command: mysql -uroot -pyourpassword peq with out issue (I set a password), but I am going to run the comand in the XAMPP guide you sent me. Edit: I ran "mysqladmin.exe -u root password secret" where I changed 'secret' to a new password and I still receive Error: #1045 Thanks for the attempt though man. On a side note, if i select Shell from XAMPP Control Panel the prompt and run the above command returns Access denied for user 'root'@'localhost' (using password: NO)' but the same command did not return an error from a cmd prompt opened from the start menu. Also: http://localhost/phpmyadmin/ and /security windows open as blank pages. (the page was blank because skype was using port 443 and it wouldn't let apache start) After I closed skype the page came up with "ACCESS DENIED Error: 1045) As this was an XAMPP issue it was easy to find an answer: http://www.ostraining.com/blog/codin...45-phpmyadmin/ I corrected the localhost/phpadmin issue by editing the password in config.inc.php and was able to access the php admin console. I see what was meant by the password used =yes or no. So I went into the users area and changed the password of the localhost that had a password set to YES to the password I set for my sql root account. I also made a new user account named eq@localhost (my 1045 error says access denied to eq@localhost) then i stopped and restarted sql, apache, and XAMPP, and that didn't work so I restarted my computer. That didn't work either so I came back to update my post with my new failure. |
All times are GMT -4. The time now is 11:23 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.