LoginSignup
37
33

More than 3 years have passed since last update.

MySQLで照合順序の確認と変更

Last updated at Posted at 2019-11-26

データベース単位

SELECT @@character_set_database, @@collation_database;
ALTER DATABASE COLLATE 'utf8_general_ci'

テーブル単位

show table status from データベース名;
ALTER TABLE テーブル名 COLLATE 'utf8_general_ci';

カラム単位

use information_schema;
select table_name, column_name, collation_name from columns  where table_schema="データベース名" and collation_name is not null

use データベース名
ALTER TABLE テーブル名 MODIFY COLUMN カラム名 varchar (255) COLLATE 'utf8_general_ci';
37
33
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
37
33