Koozali.org: home of the SME Server

Access denied for user: 'root@localhost'

davn8r

Access denied for user: 'root@localhost'
« on: September 09, 2004, 03:54:16 AM »
Hi - just installed SMEServer 6.1 - created a database called 'cots' and uploaded my schema and data into it from a saved file (all create and insert statements only), created an ibay with the following characteristics:

Group: Everyone
User access: Write=group, read=group
Public access: Entire internet (no password required)
execution of dynamic conent: Enabled

I then copied my PHP pages over and immediately got:  

Access denied for user: 'root@localhost' (Using password: YES)

when trying to access through my browser from another system on my intranet.

Other than the few tasks I have just mentioned I have done little else (changed the workgroup name for my windows network - that's about it).

The script I am running to access the mysql database looks like this:

$hostname_dbcnx = 'localhost';
$database_dbcnx = 'cots';
$username_dbcnx = 'root';
$password_dbcnx = '{the correct pw is here}';
$dbcnx = mysql_pconnect($hostname_dbcnx, $username_dbcnx, $password_dbcnx) or die(mysql_error());

And, yes, the correct password is specified.

I am trying to convert my in-house server from Win2000 and have spent the last 2 days and finally just gave up and re-installed but immediately hit this same problem.

Anyone have any ideas on how I can fix this without crippling phpmyadmin?

Offline smeghead

  • *
  • 563
  • +0/-0
Access denied for user: 'root@localhost'
« Reply #1 on: September 09, 2004, 05:50:24 AM »
Poss a perms/ownership issue on the ibay; try setting the user access to something else and then reset it back to what it is now.  This process will reset all the file/folder attributes in the ibay.

When you copy files much of the time the copy will reset the perms (chmod) and the ownership (chown) to that of the currently logged in user.

HTH
..................

davn8r

Access denied for user: 'root@localhost'
« Reply #2 on: September 10, 2004, 05:31:37 AM »
Quote from: "smeghead"
Poss a perms/ownership issue on the ibay;


I don't think that's the problem - I can access the .php files fine on the ibay - it's the access to the MySql database that these files are calling that produces the error.

I resolved it by simply creating another user ('davo@%) and granting all privs and then changed my script to use that user/pw combo and all is well.

Never could figure out why it didn't like the root/pw auth when I KNOW that the password was correct.

Thank you for your advice - I will keep an eye on permissions as I move files over!

guest22

Access denied for user: 'root@localhost'
« Reply #3 on: September 11, 2004, 01:11:09 AM »
It sounds like somehow you changed your MySQL root password.

Perform a search on Mysql password and take a look at Dan Brown's documents

davn8r

Access denied for user: 'root@localhost'
« Reply #4 on: September 11, 2004, 03:33:13 AM »
Quote from: "guest22"
It sounds like somehow you changed your MySQL root password.

Perform a search on Mysql password and take a look at Dan Brown's documents


I looked at Dan's documents and I did apply changes he recommended earlier but somehow everything got out of sync betweeh MySQL, phpmyadmin and my ibay documents so I did a fresh install after that which got me to where I am now.

I agree with you that it seems that my MySQL pw is not correct but all that I did after my fresh install is load up phpmyadmin - I wonder if that could have done it?

guest22

Access denied for user: 'root@localhost'
« Reply #5 on: September 11, 2004, 09:35:53 AM »
what version of phpmyadmin and where from?

davn8r

Access denied for user: 'root@localhost'
« Reply #6 on: September 11, 2004, 04:35:03 PM »
I downloaded the rpm file from:

http://mirror.contribs.org/smeserver/contribs/nightspirit/e-smith-phpmyadmin/

I used version 2.6.0-rc2

guest22

Access denied for user: 'root@localhost'
« Reply #7 on: September 11, 2004, 05:05:53 PM »
Did you try this ?:

Quote

 Resetting the root password
Suppose you've already changed the root password, not realizing why it's such a bad idea.  Here's how to set it back to where it belongs:

[root@e-smith /root] # /etc/rc.d/init.d/mysqld stop
[root@e-smith /root] # /etc/e-smith/events/actions/conf-mysql-password
[root@e-smith /root] # /etc/rc.d/init.d/mysqld start


From this doc: http://www.familybrown.org/howtos/mysql-password-howto.html

btw: by the looks of your first post, you have changed the password with uploading your .sql file. You don't want to give a script root access to mysql. Create a seperate user instead of using root.

If the above does not work, start over and make sure you create a db user FIRST other that root, grant the correct privillages and change the .sql file to be uploaded to reflect the newly created user instead of root.

Good luck.

davn8r

Access denied for user: 'root@localhost'
« Reply #8 on: September 12, 2004, 06:46:15 AM »
I did the familybrown thing on my first install which fixed my phpmyadmin problem but caused all of my webpages to fail, hence the re-install.

The database creation script that I used was a dump of my other MySQL database made using phpmyadmin on my old machine and had no grant statements or anything dangerous in it.

This web server is only used by my family internally so I am not that worried about root access - I would never use root access on a production site out on the net to be sure.

My work-around was basically pretty close to what you recommended - I created a different user, granted the privs I needed and changed my connection script to reference the new user.

Thanks for your input and taking the time to respond - I always appreciate any help from the braintrust!

-Dave-