[odb-users] ERROR 1044 (42000): Access denied for user ''@'localhost' to database

Boris Kolpackov boris at codesynthesis.com
Mon Jan 6 02:42:13 EST 2014


Hi,

378549984 <378549984 at qq.com> writes:

> I've installed all those libraries needed, and configured the 
> odb-example-2.3.0 successfully on my Ubuntu12.04. But when I
> want to run next command "make check",it came out to be an ERROR: 
> 
> ERROR 1044 (42000): Access denied for user ''@'localhost' to database
> 'odb_test'

When configuring the ODB examples you can use --with-mysql-* options
(run configure --help to see the list of them) to specify the MySQL
user, password, and database that the examples should use.

Running examples as the root MySQL user is a really bad idea. Instead,
I suggest that you use a different database user. Here is how you can
create a separate user and database for ODB:

Login to mysql as root and then run these SQL statements:

CREATE USER odb_test@'%';
CREATE USER odb_test@'localhost';
CREATE DATABASE odb_test;
GRANT ALL PRIVILEGES ON odb_test.* to odb_test@'%';
FLUSH PRIVILEGES;

This will create a new user called odb_test and a new database
also called odb_test. The odb_test user will have no password.

Once this is done, configure the ODB examples like this:

./configure --with-database=mysql --with-mysql-user=odb_test \
--with-mysql-password=no --with-mysql-db=odb_test ...

Also note that here we assume that you run the examples on the
same machine as the the MySQL server itself. If that's not the
case, then use the --with-mysql-host option to specify the
remote MySQL host.

Boris



More information about the odb-users mailing list