I'm trying to upgrade DBD::mysql and having trouble with the anonymous
user for the test database. When I run the install the tests fail with
messages like:
DBI connect('test','',...) failed: Access denied for user:
'root@localhost' (Using password: NO) at t/50chopblanks.t line 57
Cannot connect: Access denied for user: 'root@localhost' (Using
password: NO)
Either your server is not up and running or you have no
permissions for acessing the DSN DBI:mysql:test.
This test requires a running server and write permissions.
Please make sure your server is running and you have
permissions, then retry.
According to the mysql manual:
"The DBD::mysql installation runs a number of tests. These tests require
being able to connect to the local MySQL server as the anonymous user
with no password. If you have removed anonymous accounts or assigned
them passwords, the tests fail."
I haven't changed the anonymous user accounts AFAIK. I did add some
extra accounts. My mysql.user table looks like this:
mysql> select host,user,password,select_priv from user;
+--------------------+----------------+------------------+-------------+
| host | user | password | select_priv |
+--------------------+----------------+------------------+-------------+
| localhost | root | 5b3e0551192fc0ec | Y |
| suse3.lmb.internal | root | 5b3e0551192fc0ec | Y |
| localhost | | | N |
| suse3.lmb.internal | | | N |
| % | test | 378b243e220ca493 | N |
| % | test@localhost | 378b243e220ca493 | N |
| localhost | test | 378b243e220ca493 | N |
+--------------------+----------------+------------------+-------------+
7 rows in set (0.00 sec)
There's also a user comment on the mysql manual:
"Note that if you've been a good doobie and already changed the root
password then the DBD::mysql tests will fail."
This fits my circumstances; I have indeed given root a password and a
.my.cnf file. I don't want to take it away again - it seems pretty
tedious if I have to change root's password every time I want to upgrade
modules that use mysql.
Is the user comment correct and if so, is there anything I can do to
make test installation work as normal? I don't understand why changing
root's password affects the anonymous user.
This is on SuSE 9.2 (mysql 4.0.21-Max, perl v5.8.5 built for
x86_64-linux-thread-multi)
Thanks, Dave