Can not connect MySQL DB in Mac

Hello,
I’ve tried same connection, it can connect well to MySQL Server when using in Window (Virtual machine), but when I tried in Mac, it have error like screen.

java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at v.sp.a.a(:60)
at v.aam.c.a(:41)
at v.aam.c.b(:78)
at v.aam.av.run(:25)

I’m sure connection information string is correct, Java also setup in Mac.
And I don’t know how to resolve this issue.

Please help me, thank you!

Hi manhdn,

It looks like the driver jar file does not contain the class required. Did you download the driver by pressing the download button or by other methods?

Best regards,
Jick Yeung

Thank you Jick Yeung,

I’ve download driver files from web search, not click button.
When I click button it require host, port, login & password, I don’t know it.

Regards,
Manh

Hi Jick Yeung,

After I tried download connector from https://dev.mysql.com/downloads/connector/j/ it can run well now.

Thanks,
Manh

Hi Manh,

You are welcome. Feel free to contact us if you have other questions. :slight_smile:

Best regards,
Jick Yeung