1.登陆:mysql -u root -p
2.查看密码: select host,user,authentication_string from mysql.user;
3.使用JDBC连接MySql时出现:The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration
解决方案:在连接字符串后面加上?serverTimezone=UTC,其中UTC是统一标准世界时间。
完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTC
或者:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题
结合也可以使用:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
Mysql日常需要用到的命令
最新推荐文章于 2022-07-01 20:33:09 发布