[GRASSLIST:5016] latest 5.7-cvs can't connect to MySQL

Hi everyone,

I just noticed that I can no longer connect to my MySQL tables from within
GRASS 5.7-cvs..

before I could execute:
db.connect driver=mysql
database="host=localhost,dbname=test,user=xxxx,password=xxxx"

and i could then work with tables in MySQL...

now, even after setting the connection parameters with db.connect, i get the
following errors when executing `db.tables -p`:

-------------error messages-------------
db.tables -p
WARNING: 'user' in database definition is not supported, use db.connect
WARNING: 'password' in database definition is not supported, use db.connect
DBMI-MYSQL driver error: mysql_real_connect() error (1045): Access denied for
user: 'dylan@localhost' (Using password: NO)
------------------------------------------------

and the following shows up in mysql.log
----------mysql.log------------
Access denied for user: 'dylan@localhost' (Using password: NO)
----------------------------------

...somehow GRASS 5.7-cvs from last month was able to connect to mysql, but the
latest one is having problems passing some parameters (username and password)
to mysql

any ideas?

thanks in advance

--
Dylan Beaudette
Soil Science Graduate Group
University of California at Davis

Just noticed that there was a change in the mysql driver in db.c according to
the changelog:

-------------------------------------------------------
2004-11-24 10:14 radim

* db/drivers/: postgres/db.c, postgres/parse.c, mysql/db.c: login
-------------------------------------------------------

is see that some lines have been commented out in db.c:

-------------------------------------------------------
else if ( strncmp(tokens[i], "user", 4 ) == 0 )
G_warning ( "'user' in database definition is not supported, use
db.connect" );
/* myconn->user = G_store ( tokens[i] + 5 ); */
else if ( strncmp(tokens[i], "password", 8 ) == 0 )
G_warning ( "'password' in database definition is not supported, use
db.connect" );
/* myconn->password = G_store ( tokens[i] + 9 ); */
-------------------------------------------------------

...so that would explain what the errors are all about in my previous post.
Now the question would be, where can I safely specify my username and
password for connecting to the MySQL db?

thanks,

On Wednesday 01 December 2004 01:06 pm, Dylan Beaudette wrote:

Hi everyone,

I just noticed that I can no longer connect to my MySQL tables from within
GRASS 5.7-cvs..

before I could execute:
db.connect driver=mysql
database="host=localhost,dbname=test,user=xxxx,password=xxxx"

and i could then work with tables in MySQL...

now, even after setting the connection parameters with db.connect, i get
the following errors when executing `db.tables -p`:

-------------error messages-------------
db.tables -p
WARNING: 'user' in database definition is not supported, use db.connect
WARNING: 'password' in database definition is not supported, use db.connect
DBMI-MYSQL driver error: mysql_real_connect() error (1045): Access denied
for user: 'dylan@localhost' (Using password: NO)
------------------------------------------------

and the following shows up in mysql.log
----------mysql.log------------
Access denied for user: 'dylan@localhost' (Using password: NO)
----------------------------------

...somehow GRASS 5.7-cvs from last month was able to connect to mysql, but
the latest one is having problems passing some parameters (username and
password) to mysql

any ideas?

thanks in advance

--
Dylan Beaudette
Soil Science Graduate Group
University of California at Davis

Use db.login:
http://grass.itc.it/pipermail/grassuser/2004-November/027074.html

Radim

Dylan Beaudette wrote:

Hi everyone,

I just noticed that I can no longer connect to my MySQL tables from within GRASS 5.7-cvs..

before I could execute:
db.connect driver=mysql database="host=localhost,dbname=test,user=xxxx,password=xxxx"

and i could then work with tables in MySQL...

now, even after setting the connection parameters with db.connect, i get the following errors when executing `db.tables -p`:

-------------error messages-------------
db.tables -p
WARNING: 'user' in database definition is not supported, use db.connect
WARNING: 'password' in database definition is not supported, use db.connect
DBMI-MYSQL driver error: mysql_real_connect() error (1045): Access denied for user: 'dylan@localhost' (Using password: NO)
------------------------------------------------

and the following shows up in mysql.log
----------mysql.log------------
Access denied for user: 'dylan@localhost' (Using password: NO)
----------------------------------

...somehow GRASS 5.7-cvs from last month was able to connect to mysql, but the latest one is having problems passing some parameters (username and password) to mysql

any ideas?

thanks in advance

On Wed, Dec 01, 2004 at 01:29:10PM -0800, Dylan Beaudette wrote:

Just noticed that there was a change in the mysql driver in db.c according to
the changelog:
-------------------------------------------------------
2004-11-24 10:14 radim

* db/drivers/: postgres/db.c, postgres/parse.c, mysql/db.c: login
-------------------------------------------------------

...

...so that would explain what the errors are all about in my previous post.
Now the question would be, where can I safely specify my username and
password for connecting to the MySQL db?

thanks,

On Wednesday 01 December 2004 01:06 pm, Dylan Beaudette wrote:
> Hi everyone,
>
> I just noticed that I can no longer connect to my MySQL tables from within
> GRASS 5.7-cvs..
>
> before I could execute:
> db.connect driver=mysql
> database="host=localhost,dbname=test,user=xxxx,password=xxxx"

Hi Dylan,

the login mechanism was rewritten (Radim sent a mail).
I have also updated the documentation of 'db.connect' and added
docs for 'db.login'. Please have a look at the current module
descriptions ('g.manual -i &' opens the index).

Currently I am migrating the GRASS 5.7/6.0 Tutorial to the
WIKI. Above change is already covered:

http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassSixTutorial
-> Vector data management
  -> GrassSixTutorialAttributeManagement

Please note that I am working on these documents, they are not yet
completely migrated from the older 5.7 tutorial.

Cheers

Markus