Setting defaults in client (create database collation)

alturic's profile image alturic posted 10 months ago in HeidiSQL portable Permalink

I know it's a silly question but is there a way to set the default collation for creating new tables? HeidiSQL correctly shows me what the servers default collation is, but it'd be a nicety to be able to specify what to use as the default in HeidiSQL.

Am I missing an option somewhere or is that just not implemented?

ansgar's profile image ansgar posted 10 months ago Permalink

Collation is inherited from server to database, to tables, and finally to columns.

So I think what you want is to modify the database collation, like I just did in the "Alter database" dialog (right-click on database > edit). Setting your preferred collation will set the default collation for newly created tables:

Description

Note your existing tables won't get touched by that, as you just change the default collation for new tables.

alturic's profile image alturic posted 10 months ago Permalink

Hmm, perhaps the wording is either confusing or I'm not explaining it right. When I create a database in HeidiSQL it wants to use utf8mb4_unicode_ci, but it then tells me (like yours) the server default is utf8mb4_0900_ai_ci, which is indeed what I expect all of my tables to be.

Where is HeidiSQL getting the utf8mb4_unicode_ci default from? Shouldn't it (unless it simply "can't") be what the server default is, unless there would be a way to configure that in HeidiSQL to begin with.

Please login to leave a reply, or register at first.