[问题处理]MySQL5.7问题集

2018-02-17  本文已影响0人  杨山炮

安装背景:

Bug1简介: mysql5.7安装后,会自动启动服务,在这个时候输入net start mysql 会出现服务名无效的问题.
解决方案:

mysql服务无效.jpg

       

Bug2简介:在生成data文件之后出现的情况Mysql ERROR 1045 (28000) Access denied for user 'root'@'localhost'

Mysql ERROR 1045 (28000) Access denied for user 'root'localhost'的原因.png
解决方案:
3.0 C:\Users\hp>net start mysql 发生系统错误 5。 拒绝访问。
cmd程序没有够高的执行权限造成的系统错误.png

以管理员身份运行cmd.exe 然后net start mysql

管理员身份下的命令运行结果.png

MySQL字符编码问题

[Err] 1366 - Incorrect string value: '\xE7\x94\xB5\xE8\xA7\x86...' for column 'sName' at row 1

方法一:在当前窗口设置数据库编码格式为gbk,set
character_set_results=gbk;

方法二:在mysql安装目录下有my.ini文件
default-character-set=gbk 客户端编码设置
character-set-server=utf8 服务器端编码设置

方法三:在创建表而定时候指定默认字符编码格式为utf8,default charset=utf8

新版本mysql-connector-java-8.0.11 jdbc驱动安全限制

报错一:Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

报错二: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 property) to use a more specifc time zone value if you want to utili

String url = "jdbc:mysql://localhost:3306/mydb?useSSL=false&serverTimezone=UTC";
String user = "root";
String password = "123456";
Connection conn = DriverManager.getConnection(url, user, password);
上一篇下一篇

猜你喜欢

热点阅读