Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Mysql return error Unknown collation: 'utf8mb4_0900_ai_ci' when run rails db:schema:load

Parent

Mysql return error Unknown collation: 'utf8mb4_0900_ai_ci' when run rails db:schema:load Question

+3
−0

I tried to install on my free GCP VM compute but when run rails db:schema:load

return error:

-- create_table("abilities", {:options=>"ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", :force=>:cascade})
rails aborted!
ActiveRecord::StatementInvalid: Mysql2::Error: Unknown collation: 'utf8mb4_0900_ai_ci': CREATE TABLE `abilities` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `community_id` bigint, `name` varchar(255), `description` text, `internal_id` varchar(255), `icon` varchar(255), `post_score_threshold` decimal(10,8), `edit_score_threshold` decimal(10,8), `flag_score_threshold` decimal(10,8), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `summary` text,  INDEX `index_abilities_on_community_id`  (`community_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

It was worked fine on my Mac OS, what's wrong with my ubuntu?

Maybe I need to install/activate utf8mb4_0900_ai_ci, but how to do it? I cant find any resource about install it, just suggestion to change it to utf8mb4_general_ci

My software specification:

  • Ubuntu 18.04
  • mysql 5.7.32-0ubuntu0.18.04.1-log
  • Ruby 2.6.6
  • gem 3.0.3
  • rails 5.2.4.4
  • rbenv 1.0.0
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

General comments (3 comments)
Post
+2
−0

The problem is the version of MySQL. This collation was added with MySQL 8.0 and is the new default. MySQL 5.7.32 does not have it. Since the create table statement includes it, clearly it is designed for MySQL 8.0 or above.

A big related question is whether there are any functional requirements in Codidact that need MySQL above 5.7.32. If there are, then the only practical solution is to install MySQL 8.0 or above in your system, or connect to a MySQL server elsewhere that is running 8.0 or above.

If there are no issues other than the collation, you can change all references to utf8_general_ci or another common collation. See https://stackoverflow.com/questions/57546833/how-to-take-a-dump-from-mysql-8-0-into-5-7 for a similar question.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

General comments (2 comments)
General comments
Yaskur‭ wrote almost 4 years ago

that's right, I upgraded to 8.0 and now working fine, maybe just need to write requirement specification on readme.md.

ArtOfCode‭ wrote almost 4 years ago

utf8_general_ci won't work; the only realistically viable collation for a modern web app is utf8mb4_unicode_ci