BigLebowski Posted July 14, 2011 Share Posted July 14, 2011 hi there As root, I can simply type "mysql" then issue this command (eg) to modify any server database: SET PASSWORD FOR 'fred'@'localhost' = PASSWORD('newpassword'); However when I run a php script containing: mysql_connect('localhost', 'fred', ''); as root, I'm getting Access Denied. How can I get round this? I don't have a full list of all database user passwords but just want to use my "root" status to override the need for a password in php. Many thanks Dude Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2011 Share Posted July 14, 2011 Your using fred as your username to connect, try using root. Quote Link to comment Share on other sites More sharing options...
BigLebowski Posted July 14, 2011 Author Share Posted July 14, 2011 doh thanks lol I've tried the root ssh password but it doesn't work. Is there a way I can find out what the existing root MySQL password is? I don't want to reset it in case I screw something up? Best Dude Quote Link to comment Share on other sites More sharing options...
trq Posted July 14, 2011 Share Posted July 14, 2011 Nope. If your not sure what it is you will need to reset it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.