现在用orm比较多,很多mysql表啊都不用自己创建,但是数据库还是要自己创建,记录下sql, 备忘. CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password'; FLUSH PRIVILEGES; 声明: 本文出自 "orangleliu笔记本" 博客,转载请务必保留此…
GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci; UTF8: CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci…
转载自新浪博客 Sean 一. mysql中utf8编码的utf8_bin,utf8_general_cs,utf8_general_ci的区别 utf8_general_ci 不区分大小写,这个你在注册用户名和邮箱的时候就要使用. utf8_general_cs 区分大小写,如果用户名和邮箱用这个 就会照成不良后果 utf8_bin: compare strings by the binary value of each character in the string 将字符串每个字符串…