java - JDBC Connection error to mysql Access Denied for user @ -


I have already checked other stack overflow and web links:

MySQL is a Linux Is the server

  Linux uslx600 2.6.32-358.14.1.el6.x86_64 # 1 SMP Mon   

Its IP is 1.2.3.4 < / Code>

I can connect it to my laptop using MySQL Workbench. I can not attach the image due to stack overflow policy, but the dialog is as follows:

  Connection Method: TCP / IP Hostname: & lt; Server's host, hence 1.2.3.4 & gt; Port: 3306 & lt; This is the same port mentioned for JDBC connection & gt; Username: bug default schema: bug   

within that mysql I have [select user], current_user ()] , me

  • User () I am trying to connect to a Linux server where MySQL is database.

    The following works, the user is the user himself, i.e. no "@%" or nothing:

      conn = DriverManager.getConnection ( "Jdbc: mysql: // localhost: 3306 / worm", user, password);   

    The following also works:

      conn = DriverManager.getConnection ("jdbc: mysql: //127.0.0.1: 3306 / bug", user , Passwd);   

    But that does not work, if I give the IP address of box or hostname. And what I'm actually working on is accessing it from some other Linux server, which probably does not work due to the same problem.

    Error message when it fails:

      denied access to user 'bug' @ '& lt; Hostname of the server & gt; ' (Using password = yes)   

    If there is some access problem on the server, should not there be a similar problem in the MySQL workspace?
    and current_user () says bug @% does not it mean that the user is setup correctly?

    I also tried to convert the user to 'user' @ '%' etc., but in all those cases, the error message always was:

      'bug' @ '%' @ '& Lt; Hostname & gt; '    

    Ensure that you have given all host privileges to all the privileges.

    Check your my.cnf file and the bind-address if it only points to 127.0.0.1



Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -