I have a problem with settings.php file. I want all user with an account can access to mysql db with their some one username and password and not with a common account with all privileges on drupal DB as specified by default in settings.php.
I made a different database and I set only "SELECT" privileges on this. Now, my problem is this:
In settings.php I set:
global $user;
$db_url['default'] = 'mysql://xxx:xxx@localhost/drupal';
$db_url['mydb'] = "mysql://$user->name:$user->pass@localhost/mydb";
But it doesn't work. The $user->name doesn't work in this file. It works in all others but not here! I tried also to "print $user->name" but nothing! So I obtain this error message:(also after login, not only by anonymous users):
warning: mysql_connect(): Access denied for user: 'root@localhost' (Using password: YES) in /Library/WebServer/Documents/drupal/includes/database.mysql.inc on line 31.
Please help me! Thanks