Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charset definition doesn't take effect on new databases #14491

Open
dddns opened this issue Jul 19, 2018 · 7 comments
Open

Charset definition doesn't take effect on new databases #14491

dddns opened this issue Jul 19, 2018 · 7 comments
Labels
enhancement A feature request for improving phpMyAdmin ui Issues relating to the user interface
Projects

Comments

@dddns
Copy link

dddns commented Jul 19, 2018

Howdy,

I have the default charset defined in config.inc.php

$cfg['DefaultCharset'] = 'utf8mb4';
$cfg['DefaultConnectionCollation'] = 'utf8mb4_general_ci';

But when I go to new databases, the default options is always:
utf8_general_ci

Shouldn't the default be utf8mb4_general_ci ?

PS: I know that if I change the default in my.ini it works, but as if i'm setting a default in PMA, is more logic to honor the PMA config than the server one.

@ibennetch
Copy link
Member

I know that the DefaultCharset directive has been removed for some time, so we know that doesn't do anything anymore.

DefaultConnectionCollation refers to the connection between the MySQL server and phpMyAdmin, so I think that wouldn't change the default option for creating a new database.

I'm not sure offhand why yours is using utf8 instead of utf8mb4; you're right that this is generally undesirable. I'd take a look in your MySQL configuration file because I suspect this default value comes from there instead of from phpMyAdmin.

@dddns
Copy link
Author

dddns commented Jul 31, 2018

Isaac,

I have MySQL with:

character-set-server = utf8
collation-server = utf8_general_ci

For other reasons.
Central question is, the configuration for PMA, shouldn't be used for all PMA environment and don't rely on MySQL settings?

$cfg['DefaultCharset'] = 'utf8mb4';
$cfg['DefaultConnectionCollation'] = 'utf8mb4_general_ci';

Am I thinking right? At least that's what makes sense for me, let me know if not.

PS: I know that if i change the default in mysql when i create a new database it get's that charset, but from mysql and not from PMA settings.

@ibennetch
Copy link
Member

ibennetch commented Jul 31, 2018

I think there's no setting in phpMyAdmin to control this value.

$cfg['DefaultCharset'] has been removed entirely and doesn't do anything anymore (I think it was removed with df4a6ef, which means the earliest release without it was version 3.4.0).

$cfg['DefaultConnectionCollation'] is the connection collation to use. I may be mistaken, but I think that affects the connection between MySQL and phpMyAdmin and doesn't affect the default for new databases.

Central question is, the configuration for PMA, shouldn't be used for all PMA environment and don't rely on MySQL settings?

Yes, if such a setting were to exist, but I don't think either of these are meant to control that aspect of your connection in this case.

I don't think that's a value that phpMyAdmin is currently able to change for you, I think the way things are currently implemented that it's controlled globally through the MySQL configuration or you'd have to change it manually for each database you create.

@dddns
Copy link
Author

dddns commented Jul 31, 2018

Isaac,

Oh got it, so it was removed, no efect!
If I change the value in mysql defaults, when creating new databases it appears what I defined in mysql as you stated.
But imagine I have a value in mysql like swidich_ci or so, something wierd to maintein some working app's, and i want to use the utf8mb4 as default for new things in PMA, i wont be able to.
Setting $cfg['DefaultConnectionCollation'], why not give the new databases selected value on the combo, the value here defined?

Just a suggestion (and request ;) )

@williamdes
Copy link
Member

@dddns I am also interested by this idea !
A charset selected by default is a great idea ;)

cc @ibennetch

@williamdes williamdes added enhancement A feature request for improving phpMyAdmin ui Issues relating to the user interface labels Oct 29, 2018
@dddns
Copy link
Author

dddns commented Oct 29, 2018

Great, someone thinks like me :)
In my opinion charset definition should be global, and for new databases should be the charset configured in pma and not mysql one, and for new tables, the default should be the database defined.

It's just my opinion!!

@williamdes
Copy link
Member

@kartik1000 Are you interested by this enhancement?
Basically it introduces a global cfg variable to set the default collation everywhere (only on the selects in the GUI) to not have to go select utf8mb4generalci each time you create a db, table, column for example

@williamdes williamdes added this to Needs triage in issues via automation Jun 19, 2019
@williamdes williamdes moved this from Needs triage to Enhancements in issues Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature request for improving phpMyAdmin ui Issues relating to the user interface
Projects
issues
  
Enhancements
Development

No branches or pull requests

3 participants