当前位置:   article > 正文

Unknown collation: ‘utf8mb4_0900_ai_ci‘_unknown collation: 'utf8mb4 0900 ai ci

unknown collation: 'utf8mb4 0900 ai ci

今天在敲代码的时候遇到了一个这样的错误:

这里感谢大佬的文章,经过大佬的指定,问题终于解决了,文章链接在这里,感兴趣的伙伴可以进行参考:

Unknown collation: ‘utf8mb4_0900_ai_ci_unknown collation: 'utf8mb4_0900_ai_ci-CSDN博客

这里简单解释:可能是mysql中高版本的数据库导入低版本的mysql数据库产生的报错

  1. 一、将文件中的所有
  2. utf8mb4_0900_ai_ci 替换为 utf8_general_ci
  3. utf8mb4 替换为utf8

先贴一下源码:这里所有的内容,都进行替换就可以了

一条一条复制太复杂了,有什么办法一次性替换,有vscode,进行替换

我们就需要用ctrl+f快捷键,这样就可以使用查找所有的img,并将所有img替换成images,点击左边符号,下面就可以实现替换了。注意替换时不要有空格。

  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : local
  4. Source Server Type : MySQL
  5. Source Server Version : 80029
  6. Source Host : localhost:3306
  7. Source Schema : ymzting
  8. Target Server Type : MySQL
  9. Target Server Version : 80029
  10. File Encoding : 65001
  11. Date: 07/05/2023 17:36:14
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for comment
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `comment`;
  19. CREATE TABLE `comment` (
  20. `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  21. `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  22. `comment` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  23. `time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  24. `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  25. `isuse` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL
  26. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  27. -- ----------------------------
  28. -- Records of comment
  29. -- ----------------------------
  30. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕!!!!!!!!!!', '0.00', '#000000', '0');
  31. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕1', '0.00', '#B42020', '0');
  32. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕2', '0.00', '#52C827', '0');
  33. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕3', '0.00', '#8311A0', '0');
  34. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '0.00', '#DD1919', '0');
  35. INSERT INTO `comment` VALUES ('dog', 'ymzting', '', '0.00', '#000000', '0');
  36. INSERT INTO `comment` VALUES ('dog', 'ymzting', '有时间的弹幕', '8.712107', '#000000', '0');
  37. INSERT INTO `comment` VALUES ('dog', 'ymzting', '发送弹幕', '4.633285', '#000000', '0');
  38. INSERT INTO `comment` VALUES ('dog', 'ymzting', '1111', '12.672615', '#000000', '0');
  39. INSERT INTO `comment` VALUES ('dog', 'ymzting', 'wwww', '14.069479', '#9A1919', '0');
  40. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕', '1.76306', '#000000', '0');
  41. INSERT INTO `comment` VALUES ('dog', 'ymzting', 'websocket', '2.344148', '#000000', '0');
  42. INSERT INTO `comment` VALUES ('dog', 'ymzting', '111', '3.385441', '#000000', '0');
  43. INSERT INTO `comment` VALUES ('build', 'ymzting', '弹幕', '5.381284', '#000000', '0');
  44. INSERT INTO `comment` VALUES ('build', 'ymzting', '弹幕', '13.613529', '#000000', '0');
  45. INSERT INTO `comment` VALUES ('build', 'ymzting', '11111', '2.407239', '#000000', '0');
  46. INSERT INTO `comment` VALUES ('build', 'ymzting', '11111', '5.256298', '#000000', '0');
  47. INSERT INTO `comment` VALUES ('build', 'ymzting', '1111', '2.059521', '#000000', '0');
  48. INSERT INTO `comment` VALUES ('build', 'ymzting', '11112222', '8.389185', '#000000', '0');
  49. INSERT INTO `comment` VALUES ('build', 'ymzting', '测试', '2.234286', '#000000', '0');
  50. INSERT INTO `comment` VALUES ('build', 'ymzting', '', '0', '#000000', '0');
  51. INSERT INTO `comment` VALUES ('build', 'ymzting', '33333', '3.96462', '#782D2D', '0');
  52. INSERT INTO `comment` VALUES ('build', 'ymzting', '3254524', '2.795794', '#000000', '0');
  53. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '0.83545', '#000000', '0');
  54. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '7.72843', '#000000', '0');
  55. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '10.960832', '#000000', '0');
  56. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '13.756024', '#000000', '0');
  57. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '15.708912', '#000000', '0');
  58. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '8.765993', '#000000', '0');
  59. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '2.432202', '#C50B0B', '0');
  60. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '6.952991', '#4429AF', '0');
  61. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '8.168342', '#000000', '0');
  62. INSERT INTO `comment` VALUES ('grass', 'ymzting', '1111', '2.505749', '#000000', '0');
  63. INSERT INTO `comment` VALUES ('grass', 'ymzting', '1111', '0', '#000000', '0');
  64. INSERT INTO `comment` VALUES ('grass', 'ymzting', 'wwww', '4.389952', '#000000', '0');
  65. INSERT INTO `comment` VALUES ('grass', 'ymzting', '测试能完结了吗', '3.683333', '#000000', '0');
  66. -- ----------------------------
  67. -- Table structure for user
  68. -- ----------------------------
  69. DROP TABLE IF EXISTS `user`;
  70. CREATE TABLE `user` (
  71. `id` int(0) NOT NULL AUTO_INCREMENT,
  72. `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  73. `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  74. `picture` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  75. `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  76. `role` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  77. PRIMARY KEY (`id`) USING BTREE
  78. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  79. -- ----------------------------
  80. -- Table structure for video
  81. -- ----------------------------
  82. DROP TABLE IF EXISTS `video`;
  83. CREATE TABLE `video` (
  84. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  85. `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  86. `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL
  87. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  88. -- ----------------------------
  89. -- Records of video
  90. -- ----------------------------
  91. INSERT INTO `video` VALUES ('猫咪', 'cat', '宠物,猫,动物,可爱');
  92. INSERT INTO `video` VALUES ('狗狗', 'dog', '宠物,狗,动物,汪汪');
  93. INSERT INTO `video` VALUES ('大楼', 'build', '大楼,城市,建筑,景色');
  94. INSERT INTO `video` VALUES ('草地', 'grass', '自然,景色,草原,绿色');
  95. INSERT INTO `video` VALUES ('大鹅', 'goose', '动物,家畜,散养,凶猛');
  96. INSERT INTO `video` VALUES ('人', 'people', '人类,摄影,美景');
  97. INSERT INTO `video` VALUES ('很多车', 'manycar', '汽车,城市,生活');
  98. INSERT INTO `video` VALUES ('汽车', 'car', '汽车,奢侈');
  99. SET FOREIGN_KEY_CHECKS = 1;

更换的表单

  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : local
  4. Source Server Type : MySQL
  5. Source Server Version : 80029
  6. Source Host : localhost:3306
  7. Source Schema : ymzting
  8. Target Server Type : MySQL
  9. Target Server Version : 80029
  10. File Encoding : 65001
  11. Date: 07/05/2023 17:36:14
  12. */
  13. SET NAMES utf8;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for comment
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `comment`;
  19. CREATE TABLE `comment` (
  20. `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  21. `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  22. `comment` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  23. `time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  24. `color` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  25. `isuse` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
  26. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  27. -- ----------------------------
  28. -- Records of comment
  29. -- ----------------------------
  30. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕!!!!!!!!!!', '0.00', '#000000', '0');
  31. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕1', '0.00', '#B42020', '0');
  32. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕2', '0.00', '#52C827', '0');
  33. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕3', '0.00', '#8311A0', '0');
  34. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '0.00', '#DD1919', '0');
  35. INSERT INTO `comment` VALUES ('dog', 'ymzting', '', '0.00', '#000000', '0');
  36. INSERT INTO `comment` VALUES ('dog', 'ymzting', '有时间的弹幕', '8.712107', '#000000', '0');
  37. INSERT INTO `comment` VALUES ('dog', 'ymzting', '发送弹幕', '4.633285', '#000000', '0');
  38. INSERT INTO `comment` VALUES ('dog', 'ymzting', '1111', '12.672615', '#000000', '0');
  39. INSERT INTO `comment` VALUES ('dog', 'ymzting', 'wwww', '14.069479', '#9A1919', '0');
  40. INSERT INTO `comment` VALUES ('dog', 'ymzting', '测试弹幕', '1.76306', '#000000', '0');
  41. INSERT INTO `comment` VALUES ('dog', 'ymzting', 'websocket', '2.344148', '#000000', '0');
  42. INSERT INTO `comment` VALUES ('dog', 'ymzting', '111', '3.385441', '#000000', '0');
  43. INSERT INTO `comment` VALUES ('build', 'ymzting', '弹幕', '5.381284', '#000000', '0');
  44. INSERT INTO `comment` VALUES ('build', 'ymzting', '弹幕', '13.613529', '#000000', '0');
  45. INSERT INTO `comment` VALUES ('build', 'ymzting', '11111', '2.407239', '#000000', '0');
  46. INSERT INTO `comment` VALUES ('build', 'ymzting', '11111', '5.256298', '#000000', '0');
  47. INSERT INTO `comment` VALUES ('build', 'ymzting', '1111', '2.059521', '#000000', '0');
  48. INSERT INTO `comment` VALUES ('build', 'ymzting', '11112222', '8.389185', '#000000', '0');
  49. INSERT INTO `comment` VALUES ('build', 'ymzting', '测试', '2.234286', '#000000', '0');
  50. INSERT INTO `comment` VALUES ('build', 'ymzting', '', '0', '#000000', '0');
  51. INSERT INTO `comment` VALUES ('build', 'ymzting', '33333', '3.96462', '#782D2D', '0');
  52. INSERT INTO `comment` VALUES ('build', 'ymzting', '3254524', '2.795794', '#000000', '0');
  53. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '0.83545', '#000000', '0');
  54. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '7.72843', '#000000', '0');
  55. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '10.960832', '#000000', '0');
  56. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '13.756024', '#000000', '0');
  57. INSERT INTO `comment` VALUES ('build', 'ymzting', '啦啦啦啦啦啦啦啦啦', '15.708912', '#000000', '0');
  58. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '8.765993', '#000000', '0');
  59. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '2.432202', '#C50B0B', '0');
  60. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '6.952991', '#4429AF', '0');
  61. INSERT INTO `comment` VALUES ('cat', 'ymzting', '猫猫', '8.168342', '#000000', '0');
  62. INSERT INTO `comment` VALUES ('grass', 'ymzting', '1111', '2.505749', '#000000', '0');
  63. INSERT INTO `comment` VALUES ('grass', 'ymzting', '1111', '0', '#000000', '0');
  64. INSERT INTO `comment` VALUES ('grass', 'ymzting', 'wwww', '4.389952', '#000000', '0');
  65. INSERT INTO `comment` VALUES ('grass', 'ymzting', '测试能完结了吗', '3.683333', '#000000', '0');
  66. -- ----------------------------
  67. -- Table structure for user
  68. -- ----------------------------
  69. DROP TABLE IF EXISTS `user`;
  70. CREATE TABLE `user` (
  71. `id` int(0) NOT NULL AUTO_INCREMENT,
  72. `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  73. `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  74. `picture` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  75. `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  76. `role` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  77. PRIMARY KEY (`id`) USING BTREE
  78. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  79. -- ----------------------------
  80. -- Table structure for video
  81. -- ----------------------------
  82. DROP TABLE IF EXISTS `video`;
  83. CREATE TABLE `video` (
  84. `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  85. `id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  86. `label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
  87. ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
  88. -- ----------------------------
  89. -- Records of video
  90. -- ----------------------------
  91. INSERT INTO `video` VALUES ('猫咪', 'cat', '宠物,猫,动物,可爱');
  92. INSERT INTO `video` VALUES ('狗狗', 'dog', '宠物,狗,动物,汪汪');
  93. INSERT INTO `video` VALUES ('大楼', 'build', '大楼,城市,建筑,景色');
  94. INSERT INTO `video` VALUES ('草地', 'grass', '自然,景色,草原,绿色');
  95. INSERT INTO `video` VALUES ('大鹅', 'goose', '动物,家畜,散养,凶猛');
  96. INSERT INTO `video` VALUES ('人', 'people', '人类,摄影,美景');
  97. INSERT INTO `video` VALUES ('很多车', 'manycar', '汽车,城市,生活');
  98. INSERT INTO `video` VALUES ('汽车', 'car', '汽车,奢侈');
  99. SET FOREIGN_KEY_CHECKS = 1;

 这样表单就创建成功了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/657290
推荐阅读
相关标签
  

闽ICP备14008679号