[NBLUG/talk] MySql/JDBC connnectivity issue.

ME dugan at passwall.com
Tue May 20 20:50:03 PDT 2003


> I can connect to a MySQL database with my test user using the command
> line tools, but when I use the Connector/J JDBC driver to (attempt) to
> connect to a database.  I'm getting refused connections that look like:
>
> mrp at calisto explorer]$ java testGrid
> Connect URL = jdbc:mysql://localhost/trackpoints?user=test&password=test
> java.sql.SQLException: Invalid authorization specification: Access
> denied for user: 'test at localhost.localdomain' (Using password: YES)
>
> (username/password changed in output, but the principal is there.)
>
> After a google search, it appears that I need to add permissions TCP
> connections (the command line tool uses a named pipe).  But I can't
> seem to find how to do this.  Can anybody help?

By default, mysql uses sockets (at least my distro's install.)

Check out your mysql config files. Look into adding entries for:
port            = 3306
bind-address    = 127.0.0.1

My config file is located /etc/mysql/*.cnf
Sever labels [label] exist in my config file. Each label applies to a
specific setup of mysql (server and/or client)

You could examine how your copy of mysql service is started, and then make
sure the method used to start it and iits associated label both share the
same address and port numbers. After you make changes to the section
associated with the ways you are running your clients and servers, stop
and restart the mysql service. After it is restarted, you should see
something listening on port 3306 if all is well on the mysql server end of
things.

Next, you would want to make sure any filters that could prevent access to
that port actually allow it for you. (Your mysql service may be started
with something like mysqld_safe while the less safe may exist with a name
mysqld (lacking the "safe" part to its name, inferring more safety in
using it instead of one that uses tcp ports.)

Realize that mysql is likely configured to use sockets instead of ports
and tcp for reasons of efficiency and/or security. By opening up a db
service to localhost, you open up some risks. By registering on your
published IP on the Internet, you create a greater risk.

If you can configure your other client to use sockets on the local
machine, that is the better solution.

Hope this is a sufficient push in the right direction for you.

-ME





More information about the talk mailing list