???Error executing sql: create database if not
exists `?` default character set utf8 - Could not
create connection to database server.
Attempted reconnect 3 times. Giving up.???
Unable to create the database. The password
might be incorrect or the database is not
started.
It’s hard to solve a problem without looking at the error log. Just go to pastebin.com. Copy the error you got and paste in the white space in the pastebin link and share the link after creating it
hello,
I have the same problem as the original poster.
My setup:
virtualbox virtual machine
centos 7
tomcat 7.0.76
mysql 5.6.47
war file 2.2.0
I can access the server as seen from the screenshot
So when searching for the error message in your logs, I came across this StackOverflow answer, which suggests that the issue is caused by a change in the default SELinux configuration on RHEL 7.4 and later (and, consequently, on CentOS) which, by default, disallows Tomcat from connecting to a local database via TCP. The answer there suggests disabling SELinux, which is one way to solve the issue. This other answer suggests a command that should allow Tomcat to connect to MySQL without totally disabling SELinux. Finally, this blog post has a suggested SELinux policy which will default to allowing Tomcat to connect to MySQL with SELinux running.
I don’t have any experience with any of the suggested fixes, but you might try that and see if the issue resolves itself.
I will try to use the localhost which is a unix socket as far as I understand, and I will check your suggestions about SELinux, also as I understood there is another solution by using different server for mysql.
I will try these solutions and come back to you.
your help is much appreciated @ibacher
Actually, I didn’t have a database connection error in windows, maybe you didn’t start the application as an administrator, try right-clicking and press run as administrator
and post the download link for the version you use so I can try it now as I didn’t use the software since last year