Koozali.org: home of the SME Server

HELP ! access denied on mysql admin@localhost

Offline gixmo

  • ***
  • 63
  • +0/-0
    • http://www.gixmo.nl
HELP ! access denied on mysql admin@localhost
« on: May 26, 2007, 01:24:33 PM »
I cannot access my mysql based sites anymore (joomla and phpgedview)
i get this error :
Quote
DB Error: connect failed [nativecode=Access denied for user 'admin'@'localhost' (using password: YES)] ** Array

so far i've tried the following :
Quote
cd /var/service/mysqld
 runsvctrl d .
 expand-template /root/.my.cnf
 expand-template /var/service/mysqld/set.password
 /usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < ./set.password
 runsvctrl u .

like in the wiki was told.

i have also tried :
Quote
mysql --execute="grant all privileges on *.* to admin@localhost identified by 'admin' WITH GRANT OPTION"
mysql --execute="flush privileges"

but that didn't did the trick either.
Please help!

Offline cjensen

  • *
  • 133
  • +0/-0
    • http://acenet-tech.org
Re: HELP ! access denied on mysql admin@localhost
« Reply #1 on: May 26, 2007, 04:00:49 PM »
Quote from: "gixmo"
DB Error: connect failed [nativecode=Access denied for user 'admin'@'localhost' (using password: YES)] ** Array


Quote
mysql --execute="grant all privileges on *.* to admin@localhost identified by 'admin' WITH GRANT OPTION"
mysql --execute="flush privileges"


You do NOT want the user 'admin' for this access.  This is not advisable for security reasons.  Use a non-priviledged user with his own password.  I am sure if you search you will find some references to db access with php apps.

References may use 'admin' in their instruction but this is not advisable ;-)

Craig

Offline gixmo

  • ***
  • 63
  • +0/-0
    • http://www.gixmo.nl
HELP ! access denied on mysql admin@localhost
« Reply #2 on: May 26, 2007, 04:15:11 PM »
you are absolutely right. And i will do that in the future, but for now i still can't access my website because it uses admin instead of antoher user. So how can i fix my problem?

Offline cjensen

  • *
  • 133
  • +0/-0
    • http://acenet-tech.org
HELP ! access denied on mysql admin@localhost
« Reply #3 on: May 26, 2007, 05:54:13 PM »
Change the config file/s for your apps to reflect a different user.  Then grant privileges to that user to that db only in your mysql commands, with a unique password for that user.  Reflect these in your config file and you should regain access.

Code: [Select]

[root@jensen-server ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1367 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant all on yourdb.* to yourdb_user@localhost identified by 'kHEv+UrJx4chpzhc88uApbU10InhdL0s9ujcvbd9VqIBgkRPfclLfHINjrN3fQhB67k1zkeQ';

then
Code: [Select]

mysql> flush privileges;
Query OK, 0 rows affected (0.07 sec)

mysql> \q


Craig

Offline gixmo

  • ***
  • 63
  • +0/-0
    • http://www.gixmo.nl
HELP ! access denied on mysql admin@localhost
« Reply #4 on: May 26, 2007, 07:30:46 PM »
Thanks Craig,

it was a lot of work to reconfigure all my apps but finaly everything works fine now!