[42000][1071] Specified key was too long; max key length is 767 bytes
已email字段为例,改成latin1_bin :
alter table resume
modify email varchar(255) collate latin1_bin not null comment ’email’;
或者取左边一部分来做索引
CREATE INDEX fff ON resume(email (10));
MySQL 里 varchar(64) 采用utf-8编码,能存多少个汉字?或多少个字母?
pt-table-sync使用latin1编码格式无损同步
pt-table-sync --databases=db01 h=127.0.0.1,u=xxxx,p=xxx,A=latin1 h=8.8.8.8,u=xxxx,p=xxx,A=latin1 --lock=0 --charset=latin1 --no-bin-log --no-transaction --execute --print
编译php7.1 openssl3.x版本过高?
MySQL8.0解除密码强度限制
SET GLOBAL validate_password.policy = 'LOW';
MySQL 8提供了密码验证策略,可通过系统变量设置:
LOW:基本长度要求。
MEDIUM:必须包含数字、大小写字母、特殊字符。
STRONG:增加更多字符类型和长度要求。
.sql.gz 直接解压导入MySQL,不创建临时sql文件
Linux普通分区挂载
[Server] Plugin mysqlx reported: ‘Setup of socket: ‘/var/lib/mysql/mysqlx.sock’ failed, can’t create lock file /var/lib/mysql/mysqlx.sock.lock’
2025-05-15T12:31:13.701072Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: ‘Setup of socket: ‘/var/lib/mysql/mysqlx.sock’ failed, can’t create lock file /var/lib/mysql/mysqlx.sock.lock’
因为移动了默认的数据目录导致/var/lib/mysql目录不存在,创建对应的目录即可
mkdir /var/lib/mysql/ && chown mysql:mysql /var/lib/mysql && chmod 755 /var/lib/mysql
[Warning] [MY-011068] [Server] The syntax ‘slave_skip_errors’ is deprecated and will be removed in a future release. Please use replica_skip_errors instead.
2025-05-15T12:24:59.648560Z 0 [Warning] [MY-011068] [Server] The syntax ‘slave_skip_errors’ is deprecated and will be removed in a future release. Please use replica_skip_errors instead.
replica_skip_errors=’1062,1032,1008′