Aristotle
发布于 2023-12-05 / 15 阅读 / 0 评论 / 0 点赞

mysql强制用户ssl连接

mysql 强制用户ssl连接

mysql -h 主机名(ip) -u 用户名 -P 端口 -p

show databases;

create user 'everifyer'@'%' identifyed by 'everifyertz321';

everifyer/everifyertz321

show grants for everifytz

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON . TO everifytz@`%` WITH GRANT OPTION;

ALTER USER 'encrypted_user'@'%' REQUIRE SSL;

select host, user from mysql.user;

jdbc参数

useSSL=true&verifyServerCertificate=false&requireSSL=true