在后台上,要spl就是
mysql用navicat
前端代码:https://gitee.com/xiangze/areadisplay
后端代码:https://gitee.com/xiangze/demo
要么是用`````````````````括起来,要么是不括。使用''''''''括起来,是错误的,可能把 '字段名' 整体认为是表名。
两者在linux下和windows下不同,linux下不区分,windows下区分。
主要区别就是
单引号( ' )或双引号主要用于 字符串的引用符号
如:
mysql> SELECT 'hello', '"hello"', '""hello""', 'hel''lo', '/'hello';
数据库、表、索引、列和别名用的是引用符是反勾号(‘`’) 注:Esc下面的键
如:
mysql>SELECT * FROM `select` WHERE `select`.id > 100;
如果SQL服务器模式包括ANSI_QUOTES模式选项,还可以用双引号将识别符引起来:
mysql> CREATE TABLE "test" (col INT);
ERROR 1064: You have an error in your SQL syntax. (...)
mysql> SET sql_mode='ANSI_QUOTES';
mysql> CREATE TABLE "test" (col INT);
Query OK, 0 rows affected (0.00 sec)
密码错了
代码贴出来
SpringBoot是1.5.9 不知道有没帮到你
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
你的 mysql 是多少版本的?
请大神帮忙看看怎么回事啊
<dependency> <groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> <version>0.9.5.2</version> </dependency> 没有包,pom的<dependencys>里面加入
安装数据库时,自己设置的密码
CREATE TABLE tb_area (
area_id int(2) NOT NULL auto_increment,
area_name varchar(200) NOT NULL,
priority int(2) NOT NULL DEFAULT'0',
create_time datetime DEFAULT NULL,
last_edit_time datetime DEFAULT NULL,
PRIMARY KEY(area_id),
UNIQUE KEY UK_AREA(area_name)
)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
推荐SQLyog
喔喔 难怪看不懂他这波操作
Mac 上的 MySQL 管理工具 -- Sequel Pro
同学好,这得和你的Spring版本严格对应起来,否则isClosed这个方法没有被实现,也就是c3p0版本不相符,你可以看看你的maven dependencies里的jar有没有重复的c3p0.
下面是我的pom
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.imooc</groupId> <artifactId>o2o</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>o2o</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.8.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic --> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> <!-- Servlet web --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> </dependency> <!-- json解析 --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> </dependency> <!-- Map工具类 对标准java Collection的扩展 spring-core.jar需commons-collections.jar --> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> </dependency> <!-- 数据库 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- 图片处理 --> <!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator --> <dependency> <groupId>net.coobird</groupId> <artifactId>thumbnailator</artifactId> <version>0.4.8</version> </dependency> <!-- https://mvnrepository.com/artifact/com.github.penggle/kaptcha --> <dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.2</version> </dependency> <!-- redis客户端:Jedis --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.1</version> </dependency> <!-- 二维码相关 --> <!-- https://mvnrepository.com/artifact/com.google.zxing/javase --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.3.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz --> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.45</version> </dependency> <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp --> <dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.9.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build></project>
因为int如果设为空的话默认为0而Integer为Null.. Null对于程序来说比较好控制,可以做空值判断以及对数据做统一处理
把单引号全部去掉就行了
已解决,是版本的问题,下载了最新的补丁版。没事了!
百度一下,再说
就是数据库管理工具,比较推荐Navicat和SQLyog
随便一个工具就行了,sqlyog,navicat(推荐),cmd下也是可以的
如何你是Windows系统的话可以用这个Navicat Premium
同学好,我的可视化工具是sequel pro
请同学检查下端口,mac有的是3307,并且确保你的mysql服务已经起来了。必要的话,去补一下数据库安装相关的知识:)
同学好 你问的是sql客户端吗,如果是的话mac的话翔仔用sequel pro(视频里用的是这个), win的话用navicat