May i know below collation_name is wrong or correct? MySQL version is 5.7.
I did follow this How to Fix the Collation and Character Set of a MySQL Database, still having the error below.
Casper `utf8_bin` is not correct if you are using Jira 8+. You need to migrate your database to `utf8mb4_bin` to get rid of collation error in health check.
If you look closely on the page you have linked, there are queries to help you do this process.
hi, thanks for the reply, do you mean below queries?
i did the below queries , still getting the same out put ...
SELECT CONCAT('ALTER TABLE ', table_name, ' CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;')
FROM information_schema.TABLES AS T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` AS C
WHERE C.collation_name = T.table_collation
AND T.table_schema = 'yourDB'
AND
(
C.CHARACTER_SET_NAME != 'utf8mb4'
OR
C.COLLATION_NAME != 'utf8mb4_bin'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you run this query you will get bunch of queries as output, and later you need to run these queries to get desired output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to run queries that you are getting in output of above query.
'ALTER TABLE ... CHARACTER SET utfmb4 COLLATE utfmb4_bin'
...
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to run queries that you are getting in output of above query.
'ALTER TABLE ... CHARACTER SET utfmb4 COLLATE utfmb4_bin'
...
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@CasperHere are steps that I followed
SELECT CONCAT('ALTER TABLE ', table_name, ' CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;')
FROM information_schema.TABLES AS T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` AS C
WHERE C.collation_name = T.table_collation
AND T.table_schema = 'yourDB'
AND
(
C.CHARACTER_SET_NAME != 'utf8mb4'
OR
C.COLLATION_NAME != 'utf8mb4_bin'
);
SELECT CONCAT('ALTER TABLE `', table_name, '` MODIFY `', column_name, '` ', DATA_TYPE, '(', CHARACTER_MAXIMUM_LENGTH, ') CHARACTER SET utf8mb4 COLLATE utf8mb4_bin', (CASE WHEN IS_NULLABLE = 'NO' THEN ' NOT NULL' ELSE '' END), ';')
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'yourDB'
AND DATA_TYPE = 'varchar'
AND
(
CHARACTER_SET_NAME != 'utf8mb4'
OR
COLLATION_NAME != 'utf8mb4_bin'
);
SELECT CONCAT('ALTER TABLE `', table_name, '` MODIFY `', column_name, '` ', DATA_TYPE, ' CHARACTER SET utf8mb4 COLLATE utf8mb4_bin', (CASE WHEN IS_NULLABLE = 'NO' THEN ' NOT NULL' ELSE '' END), ';')
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = 'yourDB'
AND DATA_TYPE != 'varchar'
AND
(
CHARACTER_SET_NAME != 'utf8mb4'
OR
COLLATION_NAME != 'utf8mb4_bin'
);
In case you face some issue related to foreign key, you can switch this off and turn back on.
SET FOREIGN_KEY_CHECKS=0;
SET FOREIGN_KEY_CHECKS=1;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.