简体   繁体   中英

Mysql 5.5 Access denied <— Jboss 7

After reinstalling Mysql 5.5 on my PC mysql refuses all connections made from my Jboss 7 application server.

The configuration files have not changed only the database server instance. I can connect using the command line (same user and password as defined in the jboss config, that worked on the previous mysql instance)

I set the user and DB as follows:

    create database business_service;
    create user 'business_service'@'%' identified by 'xxxx';
    create user 'business_service'@'localhost' identified by 'xxxx';
    GRANT ALL PRIVILEGES ON business_service.* TO 'business_service'@'%' WITH GRANT OPTION;
    GRANT ALL PRIVILEGES ON business_service.* TO 'business_service'@'localhost' WITH GRANT OPTION;

At this point I am able to login to the above DB using mysql workbench and straight from the cmd line:

    mysql -u business_service -p

However when I start up Jboss 7 using the same files the connected to the previous mysql 5.5 database (New PC, but as JBoss is file system based and all the paths are the same all I needed to do was copy the file system over) it returns:

    Caused by: java.sql.SQLException: Access denied for user 'business_service'@'localhost' (using password: YES)

My assumption is there is some sort of setting saying plain text passwords are not accepted, I first tried with mysql 5.6 but had the same issue, and after messing around with all sorts of mysql settings decided to just revert back to 5.5, but no joy.

So my question is: 1) does anything jump out with regard to a switch I have not set to allow an XA JDBC resource to connect? 2) if not can I tell MYSQL to log the password that is coming in (I can see in the logs that JBOSS tries to connect) so I can see maybe it is encrypted. 3) The Mysql to allow connections without passwords (if all else fails) 4) Any other Ideas?

Thanks Marc

Be VERY careful with the characters you use in your user password for MYSQL..... I had an exclamation mark "!" as one of the characters and MYSQL does not stop you from using it, however when you login using the same password that you created the account with, it sees the password as incorrect.

Crazy waste of time, hope nobody else falls into this trap.

Cheers Marc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM