DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'

10 posts / 0 new
Last post
#1 Tue, 08/22/2006 - 07:35
MichaelDaly

DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'

Dear Forum When in Webmin, if I try to access any of the 'Global Options' on the 'MySQL Database Server', the above message appears.

Its the same message if I'm in Virtualmin and tick the 'MySql database enabled' option when in 'virtual server details'

The user I am logged in as in webmin is 'root'

Any help here, please

Michael

Sun, 06/07/2009 - 07:00
Joe
Joe's picture

Hey Michael,

You need to tell Webmin's MySQL module your username and password for the root account in MySQL (this is separate and possibly wholly different than your system root password).

Click on Module Config in the MySQL module to configure this.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:00
MichaelDaly

Thanks Joe, it has worked

I think there is NO mysql admin password in my mysql setup; is it possible to set up a database password in this situation?

Sincerely
Michael

Sun, 06/07/2009 - 07:00
MichaelDaly

Thanks Joe, it has worked

I think there is NO mysql admin password in my mysql setup; is it possible to set up a database password in this situation?

Sincerely
Michael

Sun, 06/07/2009 - 07:00
Joe
Joe's picture

<i>I think there is NO mysql admin password in my mysql setup; is it possible to set up a database password in this situation?</i>

Given this error, I suspect there is a root password set.

But, yes, you can certainly reset the password. From the command line:

# mysql -u root mysql

mysql&gt; SET PASSWORD FOR root@localhost=PASSWORD('biglongpassword');
Query OK, 0 rows affected (0.06 sec)

If you've got a root password, but have forgotten it, you'll have to first stop/start mysqld with the --skip-grant-tables option:

# service mysqld stop

# mysqld --skip-grant-tables --user=root

And then run the above password setting command sequence.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:01
BurtAdjoodani

I have recently ran:

]]# yum clean all

]]# yum update

]]# ps -ef |grep sql
]]# kill -9 15409 15452 15682

]]# mysqld --skip-grant-tables --user=root &amp;

mysql&gt; UPDATE mysql.user SET Password=PASSWORD('newpwd')
-&gt; WHERE User='root';
mysql&gt; FLUSH PRIVILEGES;

----

And still I get:

DBI connect failed : Access denied for user 'root'@'localhost' to database 'mysql'

even when I went into &quot;Module Config&quot; in Webmin under
MySQL and set it to the new username and password.

-----

Info to help fix the issue:

]]# uname -a
Linux mail2.a1np.com 2.6.19-1.2288.fc5 #1 Sat Feb 10 14:52:17 EST 2007 i686 i686 i386 GNU/Linux

]]# rpm -qa |grep mysql
mod_auth_mysql-3.0.0-3
mysql-5.0.27-1.fc5
mysql-server-5.0.27-1.fc5
libgda-mysql-1.9.100-6.fc5
mysqlclient10-3.23.58-9.2
mysql-devel-5.0.27-1.fc5
libdbi-dbd-mysql-0.8.1a-1.2.1
php-mysql-5.1.6-1.2

]]# rpm -qa |grep min
wbt-virtualmin-nuvola-pushup-1.258-1
wbm-virtualmin-mailman-3.7-1
wbm-virtualmin-dav-2.3-1
wbt-virtualmin-nuvola-chocmint-1.258-1
wbm-virtualmin-svn-2.71-1
webmin-1.320-1
ust-virtualmin-nuvola-1.155-1
wbt-virtualmin-nuvola-dusk-1.258-1
wbt-virtualmin-nuvola-green-1.258-1
wbt-virtualmin-nuvola-1.258-1
wbt-virtualmin-nuvola-raspberry-1.258-1
usermin-1.240-1
wbm-virtualmin-awstats-2.6-1
virtualmin-base-1.0-38.rh
wbm-virtualmin-htpasswd-3.08-1
virtualmin-release-1.0-4.fedora

Have a Blessed day.

Sat, 07/24/2010 - 08:47
matt125

test and information_schema are all i can see when i have the password blank for the user root. i need to get my other databases back. They all diapered.

Fri, 05/13/2016 - 00:45
akp77

Software error:

DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: ccess denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90 Compilation failed in require at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32. BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.

Fri, 05/13/2016 - 00:46
akp77

Software error:

DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: ccess denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1398. at /usr/share/koha/lib/Koha/Database.pm line 90 Compilation failed in require at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32. BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/mainpage.pl line 32.

For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.

Sat, 03/23/2019 - 23:49
tejas123

DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1520. at /usr/share/koha/lib/Koha/Database.pm line 107

How to resolve?

Tejas Kulkarni

Topic locked