在java方面的有一些总结,有关java, mysql端口的,spring的
1.有 Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘a1’ at line 1
数据库名可能有关键字,关键字的可看https://blog.csdn.net/zgmu/article/details/77651498
2.USING BTREE 错误:You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to use
?near ‘USING BTREE’
using btree(name
) 高版本可放于UNIQUE KEY后面
3.mysql中文字符的可用gbk, Class.forName(“com.mysql.cj.jdbc.Driver”);conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/a1?useUnicode=true&characterEncoding=gbk”);
increasing the server configured values for client timeouts, or using the Connector/J connection property ‘autoReconnect=true’ to avoid this problem.
可通过jdbc:mysql://localhost:3306/test?
user=root&password=root&useUnicode=true&characterEncoding=gbk&autoReconnect=true&failOverReadOnly=false解决
详细的可看 https://www.cnblogs.com/jianzhixuan/category/926997.html
4.maven的 requested profile “pom.xml” could not be activated because it does not exist.
在eclipse左方菜单的 project -->properties --> maven --> 删除pom.xml,然后点击Apply便可以
5.spring运行出现错误: 找不到或无法加载主类 com.xxxx.xxxx.Application
eclipse左方菜单的
Window --> Properties --> Java --> Compiler --> Building --> Enable project specific settings --> Build path problems的Abort build when build path errors occur菜单的Incomplete build path,Circular dependencies改为 Warning,然后点击Apply.
6.编译的JDK版本和运行时JDK版本不同,调节为同一个版本便可
Exception invoking method createStandardContext
javax.management.RuntimeOperationsException: Exception invoking method manageApp
eclipse菜单 Window --> preferences --> Java --> Compiler的Complier compliance level选择所用的版本,或者project --> properties -> java compiler对project设置编译器便可.
7 . mysql端口的占用,netstat -ano |findstr 8080 根据端口号查看进程PID,
查看pid程序,tasklist | findstr “8080" pid processport
依据pid删除进程pid,如:taskkill /f /t /im /javaw.exe
mysql文件的my-ini设置,在cmd输入mysqld --initialize,net start mysql,
mysqld --remove,ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘root’; //修改密码便可
\表示本地资源,比如\192.168.0.8080;
如 http://www.xxx.xxx。表示网络资源, /(//)表示虚拟路径,(//)表示实际物理路径写法
8.数据库连接的,窗口闪退可通过重置密码或刷新页面的方式解决,
刷新页面的
加密规则还原成mysql_native_password
cmd输入ALTER USER ‘root’@‘localhost’
IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER; //修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
FLUSH PRIVILEGES; //刷新权限
请看官看看,有什么好建议可以提出.