
MYSQL
文章平均质量分 67
Myueye
这个作者很懒,什么都没留下…
展开
-
docker模拟mysql 主从
Mysql 主从简单配置demo原创 2022-06-28 12:57:38 · 263 阅读 · 0 评论 -
mysql事务
MySQL事务的一个基础理解,包含一些简单的样例原创 2021-12-12 00:09:08 · 459 阅读 · 0 评论 -
使用Hibernate: GenerationTarget encountered exception accepting command : Error executing DDL “
MySQL5版本不能使用ORDER来建表原因可能是:使用了关键字或者保留字来建表,(我这里使用了ORDER)ORDER为MySQL的关键字修改一下表名即可以下为报错信息:(可以参考一下看看)Hibernate: create table ORDER ( ORDERID integer not null, ORDERNAME varchar(255), CUSTOMER integer, primary key (ORD原创 2020-08-02 22:31:34 · 1884 阅读 · 0 评论 -
使用SQLyog连接数据库报错:cliset does not support authentication....
在连接数据库的时候报了这个错误:(我数据库是8版本,因为8版本后,密码的安全策略,因此需要将密码修改的稍微复杂一点才行)修改密码代码:use mysql;ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxxxx'; //设置的复杂一点如果在修改密码的时候报一下错误:operation alter user failed for root @ localhost则步骤改为:use mysq原创 2020-07-14 22:05:42 · 438 阅读 · 1 评论 -
解决mybatis查询时间的时候多出一个0
我数据库时间类型为Timestamp,查询后的时间多了个0;解决办法有如下:1.将时间转换成字符串,并截取所需要的部分:String time = date.toString();time.substring(0, time.indexOf("."));2:.使用SimpleDateFormat将字符串格式化:SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");String time = sdf.format(d原创 2020-07-12 16:45:17 · 2796 阅读 · 1 评论 -
this is incompatible with sql_mode=only_full_group_by
mysql报以下的错:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘information_schema.PROFILING.SEQ’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=o原创 2020-07-07 14:57:58 · 1180 阅读 · 0 评论 -
Unknown column ‘xxx’ in ‘field list‘
我这里是少加了引号,双引号或者单引号均可以;因为在sql语句里,字符串类型是需要用单引号或者双引号括起来的。使用update语句的时候,遇到这个错。原来的sql语句是:"update user set username="+username+",password="+password+",balance="+balance+"where username=?"; 更改后的语句:"update user set username='"+username+"',password='"+passwor原创 2020-07-02 16:40:57 · 266 阅读 · 0 评论 -
Centos解决mysql中文乱码问题,以及在SQLyog里乱码
首先设置mysql编码:进入mysql:mysql -u root -p //进入Mysqlshow variables like '%char%'; //查看编码 默认编码格式为latin1,因为我这里以及改好了,所以就不放图了修改mysql配置文件:在window下:在my.ini文件里[mysqld]中加入:character_set_server=utf8在centos系统:(我所做的):vi /etc/my.cnf //在[mysqld]中加入character-se原创 2020-06-28 12:18:23 · 230 阅读 · 0 评论 -
centos下下载Mysql5.7
1下载:wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm2安装:rpm mysql57-community-release-el7-9.noarch.rpm进入 /etc/yum.repos.d/ 目录:yum install mysql-server //安装mysq服务...原创 2020-04-30 12:19:11 · 227 阅读 · 0 评论 -
配置c3p0
配置c3p0连接池操作: ComboPooledDataSource cpds = new ComboPooledDataSource(); //设置驱动 cpds.setDriverClass("com.mysql.jdbc.Driver"); //设置url cpds.setJdbcUrl("jdbc:mysql://localhost:3306/fs"); cpds....原创 2020-04-11 18:38:55 · 124 阅读 · 0 评论 -
使用xml配置c3p0
使用xml配置c3p0的基本信息:1.导入包:2.在src下新建xml文件,文件名必须为:c3p0-config.xml3.配置xml文件:<?xml version="1.0" encoding="UTF-8"?><c3p0-config> <named-config name="intergalactoApp"> <!-- 连...原创 2020-04-11 18:29:41 · 622 阅读 · 0 评论 -
报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create
这个问题在网上找了很久,后来才发现是驱动和Mysql的版本不匹配的问题,可以去Mysql官网去找相应的驱动程序;我的数据库是8.0版本,一开始用的驱动程序是5.26版本,而在网上找到对应的驱动程序8.0版本:mysql-connector-java-8.0.15.jar后遇到报错:The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognize...原创 2019-11-12 18:51:14 · 576 阅读 · 0 评论