MySQL 挺有意思

时间:2021-08-28 14:48:58

1, 修改密码

mysql -u root -p

update user set Password = PASSWORD('NEWPWD') WHERE user = 'root';

FLUSH PRIVILEGES;

2, 添加远程授权

GRANT   ALL   PRIVILEGES   ON   *.*   TO   'root'@'%'   WITH   GRANT   OPTION;

3, 修改编码, my.ini

[client]
default-character-set=utf8 [mysqld]
character-set-server=utf8 [mysql]
default-character-set=utf8

4, 建表

DROP TABLE IF EXISTS `casehistory`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `casehistory` (
`id` varchar(255) NOT NULL,
`createBy` varchar(255) DEFAULT NULL,
`createOn` datetime DEFAULT NULL,
`department` varchar(255) DEFAULT NULL,
`doctorAdvice` varchar(255) DEFAULT NULL,
`hospital` varchar(255) DEFAULT NULL,
`hospitalizedNo` varchar(255) DEFAULT NULL,
`inquiryOn` datetime DEFAULT NULL,
`nextVisitOn` datetime DEFAULT NULL,
`nextVistItem` varchar(255) DEFAULT NULL,
`patientId` varchar(255) DEFAULT NULL,
`situation` varchar(255) DEFAULT NULL,
`updateBy` varchar(255) DEFAULT NULL,
`updateOn` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;