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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.