Jump to content

running php script as root to amend all databases


BigLebowski

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.