![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Mysql
文章平均质量分 96
yzh_1346983557
做一个有思想有灵魂的。。。“码农”
展开
-
mysql时间戳转换
//查看当前时间SELECT now();//查看当前时间戳SELECT UNIX_TIMESTAMP(now());//时间戳转时间SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(now()));结果:2019-01-07 09:44:311546854271(说明mysql时间戳timestamp类型默认单位是秒,不是毫秒)201...原创 2019-01-07 17:42:34 · 1903 阅读 · 0 评论 -
Mysql的utf8与utf8mb4区别,utf8mb4_bin、utf8mb4_general_ci、utf8mb4_unicode_ci区别
UTF-8是使用1~4个字节,一种变长的编码格式,字符编码。mb4即 most bytes 4,使用4个字节来表示完整的UTF-8。mysql的 utf8 编码最大字符长度为 3 字节,如果遇到 4 字节的宽字符就会插入异常了。三个字节的 UTF-8 最大能编码的 Unicode 字符是 0xffff,也就是 Unicode 中的基本多文种平面(BMP)。也就是说,任何不在基本多文本平面的 U...原创 2019-04-28 18:20:46 · 46674 阅读 · 0 评论 -
Mysql字段唯一性设置(unique index)
一。建表的时候声明:。。。`username` varchar(255) NOT NULL unique,。。。二。建表后添加:ALTER TABLE ·tb_user· ADD unique(`username`);三。navicat方式:组合索引的唯一性:参考:MySQL数据库唯一性设置(unique index)...原创 2019-04-29 10:05:48 · 1512 阅读 · 0 评论 -
mysql连接池DruidDataSource的使用、配置
记录一下使用DruidDataSource的常用配置。1.pom.xml中引入: <!-- https://mvnrepository.com/artifact/com.alibaba/druid --> <dependency> <groupId>com.alibaba</groupId&g...原创 2019-03-14 10:35:45 · 42857 阅读 · 9 评论 -
mysql查看连接数有关命令
进入mysql命令行:mysql的安装目录下面有个bin目录,先用命令进入该目录,然后用 mysql -uroot -p123456 来登录。show variables like '%max_connections%'; 查看最大连接数//set global max_connections=1000; ...原创 2019-05-14 15:42:27 · 2187 阅读 · 0 评论 -
MariaDB10.4 Galera Cluster 集群安装
一。安装环境:centos7、MariaDB 10.4 stable、3节点IP:192.168.56.122、192.168.56.123、192.168.56.124二。集群安装官网最新正式版地址:https://downloads.mariadb.org/mariadb/repositories/#mirror=shanghai-university&distro=CentO...原创 2019-07-09 18:09:57 · 2921 阅读 · 3 评论