安装完8.x版本的MySQL后,使用
set password for root@localhost = password(‘123’);
修改root密码,总是提示
ERROR 1064 (42000): 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 ‘password(‘123456′)’ at line 1
这是因为新版本的修改密码的语句有点不同,使用如下语句进行修改:
alter user ‘root’@’localhost’ identified by ‘123’;
传统的MySQL版本用下面命令
set password for root@localhost = password(‘123’);
mvn配置完成在cmd命令行执行mvn- v出现如下问题:

‘cmd’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
网上查找到的原因为环境变量配置有问题。解决方法:
在path变量中添加 %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
再次在命令行运行OK;

Linux运行SpringBoot项目出现404解决方案
修改项目的 pom.xml文件,依赖请根据自身项目情况进行摘选
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.54</version>
</dependency>
<!--druid连接池--> (更多…)
控制层:
@Controller
@RequestMapping("/")
public class UploadController {
@RequestMapping("/")
public String index(){return "upload";}
// 得到一个新的文件路径
public String realPath(String path){
SimpleDateFormat y=new SimpleDateFormat("yyyy");
SimpleDateFormat m=new SimpleDateFormat("MM");
SimpleDateFormat d=new SimpleDateFormat("dd");
Date date=new Date(System.currentTimeMillis());
String year = y.format(date);
String month = m.format(date);
String day = d.format(date);
String realPath=path+ File.separator+year+File.separator+month+File.separator+day;
File file=new File(realPath);
if(!file.exists()) file.mkdirs();
return realPath;
} (更多…)
Linux配置固定IP
TYPE=”Ethernet”
PROXY_METHOD=”none”
BROWSER_ONLY=”no”
BOOTPROTO=”static”
DEFROUTE=”yes”
IPV4_FAILURE_FATAL=”no”
IPV6INIT=”yes”
IPV6_AUTOCONF=”yes”
IPV6_DEFROUTE=”yes”
IPV6_FAILURE_FATAL=”no”
IPV6_ADDR_GEN_MODE=”stable-privacy”
NAME=”ens33″
UUID=””
DEVICE=”ens33″
ONBOOT=”yes”
#IPADDR=192.168.0.123
#GATEWAY=192.168.0.1
IPADDR=192.168.31.123
GATEWAY=192.168.31.1
NETMASK=255.255.255.0
DNS1=8.8.8.8
DNS2=114.114.114.114
保存之后重启服务:service network restart
Idea之没有网络的情况下创建SpringBoot项目
一丶创建SpringBoot有两个方式
1.没有网络的情况下使用Maven创建
1.1:用Idea创建maven项目 不要勾选 next (更多…)
2020java高级框架之SpringMVC解决乱码
1.在Tomcat文件夹下 conf 目录 server.xml文件 修改 (仅解决 get 请求)
<Connector port=”8080″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ URIEncoding=”utf-8″ />
2.在控制层添加(解决 get 请求和 post 请求的参数)
request.setCharacterEncoding("utf-8");
SpringBoot整合mybatis和ElasticSearch
1.创建客户模块和搜索模块
2.准备客户模块的静态资源(页面,实体类,数据库)
3.准备搜索模块的资源(在ES中创建客户模块的索引)
3.1 导入ES的依赖
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.5.4</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.5.4</version>
</dependency>
3.2 编写连接ES的config配置类(搜索模块) (更多…)
2020java微服务架构六之springboot教程
一、SpringBoot介绍
SpringBoot是由pivotal团队研发的,SpringBoot不是一门新技术,只是将之前的Spring,SpringMVC,data-jpa等常用的框架封装到了一起,帮助你隐藏这些框架的整合细节,实现敏捷开发。
SpringBoot就是一个工具集。
SpringBoot的特点:
1.SpringBoot项目不需要模板化的配置
2.SpringBoot中整合第三方框架时,只需要导入相应的starter依赖包,就自动整合了
3.SpringBoot默认只有一个.properties的配置文件,不推荐使用xml,后期会采用.java文件去编写配置信息
4.SpringBoot工程在部署时,采用的是jar包方式,内部自动依赖Tomcat容器,提供了多环境的配置
5.后期要学习的微服务框架SpringClound需要建立在SpringBoot的基础上 (更多…)
2020java微服务架构五之ES全文搜索引擎教程
一、ElasticSearch 介绍
1.1 引言
1.在海量数据中执行搜索功能时,如果使用mysql,效率太低
2.如果关键字输入的不准确,一样可以搜索到想要的数据。
3.将搜索关键字,以红色的字体展示。
1.2 ES的介绍 (更多…)


