How do I set utf8mb4 for MySQL?

I'm working with utf8mb4 databases in MySQL and haven't found a way to set that on the connection. Is there a way? I've tried setting characterEncoding and characterSetResults to utf8mb4, but that gets a non supported encoding error.

If I run "set names utf8mb4" on a connection, it works after that, but it's annoying to have to remember to run that Every. Single. Time.

Is there a way to set utf8mb4 on a connection? Or is there a way to set a script to run on connection start so I can put "set names utf8mb4" on there?

3 comments
Comment actions Permalink

Unfortunately, there is no way to do this now :( https://youtrack.jetbrains.com/issue/DBE-4216

We also considering the ability to run initialization scripts: https://youtrack.jetbrains.com/issue/DBE-2606

0
Comment actions Permalink

Thanks for the response! Any idea on timelines? Those issues have been open for a year or two -- seems like a fairly simple fix for the specific case. Even just an option on the connection that's hard coded to run "set names utf8mb4" on connect would work.

2
Comment actions Permalink

Chris Hynes I think I have this same problem. When you say "set names utf8mb4" to temporarily overcome this issue, where do you do it? Thanks!

0

Please sign in to leave a comment.