How would I find the cause of: Could not connect to 'jdbc:mysql://<server-address>/bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull': Could not create connection to database server. Attempted reconnect 3 times. Giving up.
I would like to know if it is a problem with my server and what to do to remedy it. That error message does not give me enough information.
Update:
I'm doing this on a test server with Jira 4.4 and all I see now is:
Error connecting to the database: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
-- This is not enough information. I want to know:
1) If it could find the server (after all FTP, HTTP etc will tell you that a host is unreachable)
2) If it could find the server then if the login details are incorrect (again FTP etc will tell you that your login is incorrect)
Currently I am not getting detail in 1) and 2) I need. Just saying "error connecting to database" is opaque and not helpful.
The answer is that the database user, bugzilla, that the bugzilla uses to read/write its database only had local access permissions. This meant that external hosts outside of the machine (i.e. the jira bugzilla migration tool) would be refused access as they are not local. A solution therefore would be to change the bugzilla user permissions to any host.
A MySQL query to do this would be like this:
CREATE USER 'bugzilla'@'%' IDENTIFIED BY PASSWORD '52819c504481470a'; GRANT ALL PRIVILEGES ON * . * TO 'bugzilla'@'%' IDENTIFIED BY PASSWORD '52819c504481470a' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
Changing the bugzilla database user permissions to any host can also be done in a free MySQL admin tool like phpmyadmin - see this screenshot.
Can you connect to the database with for example DB Visualizer using the same JDBC connection string? If you can't then likely the JDBC string is incorrect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could have also specified mismatching JDBC Driver class name (e.g. PostgreSQL instead of MySQL one).
You could try the newly released JIRA Importers Plugin 3.2 which has a more user-friendly DB setup screen where you don't specify the URL JDBC string manually, but JIM builds it for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rob, the error message is giving you exactly the information you need. The URL you are specifying is either wrong, or the credentials for that database are wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I disagree. It does not provide the specific problem. It should confirm that it could reach the URL and if so should then specify if login details are correct or not. After, all if one tries to connect to a non-existent FTP server for example, the error message would indicate that. And if one tries to connect to an existing FTP server but with incorrect login details, then, again, the error message would indicate that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As from my answer, the credentials were correct and the URL was correct. The problem was that the bugzilla user was only able to accept local logins. The error message given gave no clues about that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the error message literally:
Could not connect to 'jdbc:mysql://<server-address>/bugzilla?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=convertToNull':
?
Is so, then the "<server-address>" is a placeholder that needs to be replaced by the host-name or IP address of your MySQL server.
Have you properly configured the Bugzilla DB server connection settings?
Or perhaps you manually put this in just for this website to mask the real address for security concerns?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additionally, there's a known MySQL bug regarding version 5 that also causes this error. Please, take a look at this document:
If you're hitting this bug so this is the answer you need. I believe it's worth giving a try :)
In hope it helps,
Leandro Nunes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks but 1) I don't know how to tell exactly if I'm getting this problem (i.e. I do not see the Java stackdump described and 2) the remedy suggests a) removing some variables from the query - which I don't have anyway and b) suggests downgrading the MySQL - I can't do this on the live bugzilla system I have. I would have to export the SQL to another machine with the MySQL version that doesn't apparently have that - potentially a lot of work to do a downgrade - I've not done this before and expect that would involve persuading the Linux package manager to force install of a downgraded version. All this is potentially a lot of work which I am reluctant to do given that I can't be sure this is the problem as I am not seeing the lengthly stack dump error message described.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.