Adding XAMPP SQL database to PhpStorm gives rejected details error - mysql

I've installed XAMPP and am running the built in SQL server, but for some reason whenever I try to test the connection of the XAMPP default (test) database through PhpStorm it comes up with an error message of:
The specified database user/password combination is rejected: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'GMT Summer Time' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone.
I haven't changed any settings in phpMyAdmin in XAMPP or anything i've left all settings as default. I followed some video tutorials on YouTube and they didn't get this error.
I can create databases and tables fine in phpMyAdmin with no username or password so i'm not sure what the issue is.
Any help will be appreciated

That's a known problem with latest JDBC drivers, see: https://youtrack.jetbrains.com/issue/DBE-7727. Workarounds:
In DataSource configuration window go to Advanced tab and set serverTimezone property to UTC.
Switch DataSource driver to MySQL Connector/J for 5.1 (my version is 5.1.46)

Related

Cannot connect MySQL Server to Netbeans

I can't connect to my database using the "new connection" option by right-clicking on Databases in the services tab. I get the following error:
Error Image
Here is information about the server to help with a solution:
Server info
Additional server info
The password I have saved in keychain for the server is "password1" and the connection isn't working even though I entered that.
Ok I finally figured it out. I had to update the MySQL connector driver for Netbeans. I had version "mysql-connector-java-5.1.23-bin" installed and needed to add the new driver "mysql-connector-java-8.0.18.jar" to match the version of MySQL Workbench that I have.

MACOS / MySQL / SQL Developer connection error - timezone issue

On my Mac PC, I have installed MySQL and SQL Developer as well as the MySQL Connector/J, the official JDBC driver for MySQL, so that the MySQL tab appears in the connection window of SQL Developer.
In the SQL Developer connection window, I am filling in the following details
Connection name: test
Username : root
Password: xxxxx
In the MySql tab within this connection window, the hostname and port is auto populates the values localhost and 3306.
There is a button called 'Choose Database', when I click on this button I am getting the below error message in red color
"Status : Failure - The server time zone value 'AEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specific time zone value if you want to utilize time zone support"
How do I fix this issue so that I can connect to the MySql database from SQL developer?
PS: I am currently based in Sydney, Australia.
The problem got resolved by adding the below entries in the below mentioned file. In the new mysql database installations, this file would not be present so create the file so you will have create new plain text file with root privileges. When you start the MySQL server, this file will be read every time. The value specified below is a global parameter.
/etc/my.cnf
[mysqld]
default-time-zone='+10:00'
The single quotes should typed in not copy pasted.
And then restart the MySQL server.
Upvote to Nitin Puthran's answer.
If you have a Homebrew installation of mysql, my.cnf is in the Cellar mySql directory (not etc). For my version this is:
/usr/local/Cellar/mysql#5.6/5.6.41/my.cnf
[mysqld]
default-time-zone='+10:00'
And restart the mySql server.
I installed MySQL 8 with native packages on Mojave (10.14.6). As far as I can tell, there is no such thing as a my.cnf file. I couldn't get MySQL to recognize any my.cnf file, even by specifying one on the configuration tab of the MySQL settings applet in System Preferences. The only thing that worked for me was editing /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist and adding <string>--default-time-zone=America/Denver</string> to the Program Arguments section. Either restart your Mac or use the aforementioned applet to restart the server.
I imagine using a city name will only work if you have loaded timezone data into MySQL. mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql worked for me. Otherwise an offset like the above answers should work.

Fresh Lucee 5.2.7.63 install unable to connect to fresh MySQL 8 install

I recently setup a new AWS server to be used as a web server for some small utility apps. It's running Windows 2012. I then:
Installed Chrome
Installed Lucee 5.2.7.63 using installer
Installed MySQL 8.0.11 Community Edition using installer
Installed MySQL Workbench
Created a new schema via MySQL Workbench (which connects to MySQL just fine)
Created a datasource in Lucee server administrator which fails verification with:
Could not create connection to database server.
I tried using both a Lucee specific user, and the root user, and neither worked. When I checked the Lucee error log I saw this occur several times, once for each verification attempt:
Wed Jul 18 19:52:08 UTC 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
My guess is that I either need to force Lucee to use SSL, or force MySQL to allow a non SSL connection. Unfortunately, the Lucee administrator has no option related to SSL and doesn't allow me to modify the connect string manually. And I'm unsure how to alter settings for MySQL as I can't seem to find a my.ini file anymore.
The last time I setup a server was with MySQL 5.7 and I had no problems from start to finish, so I assume this must be a MySQL 5.8+ issue, but that is contradicted by the error message.
Update
In the end I decided to uninstall MySQL 8 and install MySQL 5.7. It was difficult to download the installer for 5.7 (I got 8 again the first time for some reason), and then there was a conflict with the MySQL installer, that didn't want to recognize the 5.7 I downloaded, but after getting through it all Lucee began connecting immediately with no problem.
I would still be interested in a solution, though, so that I can use MySQL 8 in the future.
You could try defining the datasource in your Application.cfc which will give you more control over the connection parameters. For example:
this.datasource = {
database: "mydatabase"
,type: "mysql"
,host: "hostname"
,port: 3306
,username: "myusername"
,password: "encryptedpassword"
,custom: {
useSSL: false
,useUnicode: true
,characterEncoding: "UTF-8"
}
};

Cannot connect to MySQL docker instance via DataGrip application

I have managed to successfully connect to a docker instance running MySQL via the mysql command line utility. However, I am struggling to do so via DataGrip application from JetBrains.
My mysql cli command is as follows:
mysql -h127.0.0.1 --port=8181 -uroot
The connection string that is generated in DataGrip is:
jdbc:mysql://127.0.0.1:8181
The error I am getting from DataGrip interface is:
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Is there anything that need to change in DataGrip that I am missing. I have read that the connection has to also be done via TCP. Not sure how to check that DataGrip is doing that.
Update: I eventually found the problem was the docker container I was using. It seems DataGrip is not able to connect to version 8.0.1 (mysql:8.0.1) mysql docker container. I tested using version 5.7 of the container and could successfully connect.
I was having an issue connecting MySQL 8.0.3 using DataGrip. You need to download the JDBC driver from Oracle website. Select Developer Releases (Since this is an unstable version). The 8.0.8 version worked for me. Download and save in a project folder or something similar on your computer. You will gonna need it later.
Go to DataGrip: File > DataSources. Click on the + and select Driver:
Screenshot of the Step above
On the section Driver Files > Additional files click on the + and select the jar file you just downloaded
After that on the Class dropdown select com.mysql.jdbc.Driver
Mark Dialect as MySQL
On the section URL templates, put the Name as default and Template as jdbc:mysql://{host::localhost}?[:{port::3306}][/{database}?][\?<&,user={user},password={password},{:identifier}={:identifier}>]
Click on apply
Done!
Screenshot of MySQL 8.0.3 running on Datagrip
Add a new datasource using the new driver.
If you find the following error:
[01S00] The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support
You can do a temporary fix going to the Advanced tab and setting the serverTimezone variable for UTC as an example.
There are no *.jar-files anymore. Only *.deb-packages for my OS on the Oracle site https://dev.mysql.com/downloads/connector/j/5.1.html
So I selected driver Amazon Aurora MySQL for my MySQL 8.0.3 in docker.
It works!

Toad for MySQL connection problems (Win 7 to Linux)

I have a MySQL instance running on a Linux box, and a Mac which also has Win7 (Bootcamp/VMWare). I can connect to the MySQL db from Navcat Lite for Mac with no problems, however, I prefer Toad. I installed Toad for MySQL for Win7 but it just CANNOT connect to the db. I installed ODBC for MySQL and it CAN successfully connect to the db, so it's not a firewall issue (I also tried disabling the firewall)
Here is a quick summary of what I see:
MySQL db running on Linux box, within my network, port 3306
Mac can successfully connect to the db through Navcat Lite
Toad for MySQL (Win 7) CANNOT connect to the db using a TCP connection (tried increasing connection timeout to 30 sec)
ODBC Driver for MySQL (Win 7) CAN connect to the db using the same credentials
Any help would be much appreciated!
Here is the error that Toad throws:
System.TimeoutException
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Check this bug report. Might be what you are facing.
link:
http://toadformysql.com/thread.jspa?threadID=32380
Taking in account your recent outcome from the packet sniffing, i do believe it is related to this bug report.
Toad seems to use the .net framework, according to the release notes it requires version 3.5 to be installed and the security policy set to unrestricted.
So, do you have .net 3.5 installed? if so, can you try to run toad as administrator?
PS: to set the security policy and i'm quoting from the link above:
To run Toad, the .NET security policy must be set to Unrestricted. To modify the security policy:
Select Control Panel from the Windows Start menu.
Double-click Administrative Tools.
Double-click Microsoft .NET Framework version Configuration.
Select My Computer, and then select the Runtime Security Policy
node.
Select Evaluate Assembly from the list of tasks in the right panel,
and locate and select Toad.exe in the File field.
Click Next and set the permission to Unrestricted.
Hope it helps, keep providing information.
I have the same issue with one my MySQL installations. I am able to connect using MySQL Workbench, but Toad for MySQL does not connect. Also, every application I created using MySQL .NET Connector also times out.
The solution I found was to connect the machines to the Internet and they connect instantly. I believe it has to do with the Connector and not Toad. Updating to a version beyond 5 should help.
Using freeware Toad for MySQL 8.0.0.296 (64 bit), instead using connection type TCP, use connection type SSH, insert database data like Host IP, user, password, default database and port. Also add SSH port, SSH Host IP, SSH user and password. Toad will emulate onnection directly to SSH console, the interface is the same, it works very fine, the error "Character set 'utf8mb3' is not supported by .Net Framework" is gone.