MySQL数据库指定字符集排序规则


Linux下新建MySQL数据库指定字符集排序规则、执行sql脚本

https://www.freesion.com/article/33551131222/

create database b3log_symphony default character set utf8mb4 collate utf8mb4_general_ci;

create database db_name charset utf8 collate utf8_general_ci;

create database b3log default charset utf8mb4 collate utf8mb4_general_ci;

CREATE TABLE `product` (
  `product_id` int(10) NOT NULL AUTO_INCREMENT,
  `product_name` varchar(100) NOT NULL,
  `product_tyep` varchar(32) NOT NULL,
  `sale_price` int(10) DEFAULT '0',
  `input_price` int(10) DEFAULT '0',
  `regist_time` date DEFAULT NULL,
  PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

CREATE TABLE `product1` (
  `product_id` int(10) NOT NULL AUTO_INCREMENT,
  `product_name` varchar(100) NOT NULL,
  `product_tyep` varchar(32) NOT NULL,
  `sale_price` int(10) DEFAULT '0',
  `input_price` int(10) DEFAULT '0',
  `regist_time` date DEFAULT NULL,
  PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

CREATE TABLE `product2` (
  `product_id` int(10) NOT NULL AUTO_INCREMENT,
  `product_name` varchar(100) NOT NULL,
  `product_tyep` varchar(32) NOT NULL,
  `sale_price` int(10) DEFAULT '0',
  `input_price` int(10) DEFAULT '0',
  `regist_time` date DEFAULT NULL,
  PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci