Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access denied for user 'root@127.0.0.1

Status
Not open for further replies.

tuco999

Programmer
Mar 30, 2003
9
GB
Hi,

I'm having problems with setting up the password under the root user. it seems to accept my password changes but when i try to access a command it comes up with the server at localhost failed followws by the above statement with (using password yes). I have tried uninstalling and installing again but have not managed to get passed this error. Not sure how to proceed past this as the mysql documentation is not the clearest!

Any suggestions please?

Thanks
 
What version?
OS?
How are you attemting this?
Are you going through ODBC?
tgus

____________________________
Families can be together forever...
 
this is the latest version i.e. ver 4 and my os is Win xp pro.
not sure what you mean by "going through ODBD" - i have odbc setup and i am going through dos to check.
I can connect to the databases etc through dreamweaver, for example, and am able to test and insert records etc. However, i do require the root password to be changed for security reasons.

Thanks in advance
 
I haven't tried it yet, but it looks like you can do this in MySQL-CC in the User Administration Database.

Have you tried MySQL-CC yet?
tgus

____________________________
Families can be together forever...
 
i have tried this through mysql-cc but this does'nt seem to work. basically if i set the password through mysql-cc then it comes up with the same message each time i login to mysql-cc and it stops my using the service altogther.
 
If you change the root password and you're using root when you run MySQL-CC, then you'll have to add that password into the connector.

Right click on 'MyDatabases' and choose 'Edit'. There you can add the password.

Is that what you mean?
tgus

____________________________
Families can be together forever...
 
Not exactly. I basically rick click on the root icon and edit, then change the password there. However when I click test it comes up with the same message as before. It's only when I leave this blank and click on test that it succeeds?? It just doesn't allow me to set up a password - very annoying!!
 
If you haven't done anything yet I assume that you can still connect to your MySQL by

C:\mysql\bin\mysql


Then, at MySQL prompt do the following


GRANT ALL
ON *.*
TO ROOT@'localhost'
IDENTIFIED BY "yourpassword"
WITH GRANT OPTION
;


Bye

Qatqat The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
no luck i'm afraid the error message comes up with:
error 1045 Access denied for user: '@127.0.0.1 (using password: no)

 
It looks like you have messed up all user rights

Do the following



go to DOS prompt

c:\net stop mysql and press enter

after it says service stopped succesfully start it again without reading the grant table

c:\net start mysql --skip-grant-tables

login mysql

c:\mysql\bin\mysql


execute the GRANT script

GRANT ALL
ON *.*
TO ROOT@'localhost'
IDENTIFIED BY "yourpassword"
WITH GRANT OPTION
;



Then again at mysql prompt

mysql>flush privileges;


Then log off mysql and restart the service normally

c:\net stop mysql

c:\net start mysql

Bye


Qatqat

The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
strange - it keeps saying the same error message. I have just tried uninstalling everything and starting again but everytime I try adding a password in it fails. I have read the help file but it more or less says what you have told me.
 
Have you completely uninstalled Mysql?

It should not do the same. If you uninstall it then check that the c:\mysql directory is deleted as well.

Manually delete the my.ini file in the windows directory

Bye

Qatqat The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
yep I tried that. Deleted the full mysql directory and the my.ini file. No success.
 
hey guys you are missing something here - the connection is identified as from 127.0.0.1 and not localhost, that's maybe the main prob here, when mysql cannot resolve 127.0.0.1 as localhost

try to use

GRANT ALL
ON *.*
TO ROOT@127.0.0.1
IDENTIFIED BY "yourpassword"
WITH GRANT OPTION
;

and see if it helps
 
That sounded like a good idea but it still says the say error message. Any other ideas?

Do you think it is solely a mysql issue or could it possibly be a problem with any other settings - though everything else works fine and I am able to test dynamic data etc on the localhost?
 
most of all it probs are somewhere between computer and the chair ;-)

and when you can access the data from other apps, then your prob is in that one app which is raising the error, check the settings of that app
 
piti, good point.

Which begs the question;

tuco, what program are you using? If it's MySQL-CC. Then go to your c:\ and delete the directory .mysqlcc, this seams to hold certain info about how MySQL-CC is configured.

I had a problem once and I deleted this directory and my problems went away.

HTH
tgus

____________________________
Families can be together forever...
 
Thanks guys but no luck again. At the moment it not a big problem as i'm only testing on the localhost and so don't necessarily need the root password setting.

It will only be a problem once I have this on a live system, then I may have to think about a complete reinstall of windows etc to see if that works - doh!

If in the meantime you come up with any other ideas, it would be appreciated though.

Cheers
 
can you enter mysql as root at the moment?

if so, use the mysql console (not any gui), change to the mysql database and try this

UPDATE `user` SET `password`=PASSWORD('newpasswd') WHERE `User` = 'root';
FLUSH PRIVILEGES;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top