在做JDBC连接Mysql的时候遇到了三个异常: 第一个是:mysql8.0 caching_sha2_password 这个异常是由于是因为在mysql8.0之前的密码规则是mysql_native_password,而mysql8.0以后使用的密码规则是caching_sha2_password, 我的解决办法是重设密码并指定密码规则: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'…
1. 往mysql中读写字符文本 public class Demo1 { /* 创建数据库 create database LOBTest; use LOBTest; create table testclob ( id int primary key auto_increment, resume text ); */ @Test public void add() { Connection conn = null; PreparedStatement st = null; ResultSet…
show processlist; select * from information_schema.processlist; Command: The type of command the thread is executing. 例如上面的例子中,Sleep,或者Query 时间戳timestampcreate table t_var (id VARCHAR(10),name VARCHAR(255),descs VARCHAR(500),create_time TIMESTAMP DEF…
因为换新的电脑设备,为其安装一些开发需要的应用及环境,下载了新版的Mysql8.0.13,在Eclipse中测试连接时遇到一些新的问题,遂记录. 1. Mysql 5.* 版本JDBC连接 a. 常规导入 5.* jar 包 b. 编写测试程序 package wqz.mysql.test; import java.sql.DriverManager; public class Test { private static String url = "jdbc:mysql://localhost…