随笔分类 -  MySQL

摘要:SET GLOBAL general_log = 'ON'; SET GLOBAL general_log_file = '/var/lib/mysql/query.log'; //执行下列语句来停止sql记录 SET GLOBAL general_log = 'OFF'; 阅读全文
posted @ 2024-01-23 16:58 Mrzxs 阅读(15) 评论(0) 推荐(0) 编辑
摘要:注意不同版本间的安装方式不太一样 ②如果出现:Error: GPG check FAILED 这是gpg验证不通过的原因,因为我是在centos8系统上安装mysql57-community-release-el7-10.noarch.rpm,即el7本身应该在centos7上安装的,但是5.7没有 阅读全文
posted @ 2022-11-25 15:34 Mrzxs 阅读(302) 评论(0) 推荐(0) 编辑
摘要:wget -i -c https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm yum -y install mysql80-community-release-el7-1.noarch.rpm ##如果不加--nogpgc 阅读全文
posted @ 2022-10-15 23:52 Mrzxs 阅读(33) 评论(0) 推荐(0) 编辑
摘要:1、先关闭mysql服务 systemctl stop mysql 2、修改配置文件,添加免密码登陆 vim /etc/my.cnf在[mysqld]下面添加一行skip-grant-tables增加:skip-grant-tables 3、重新启动mysql服务,并从新连接到数据库,记得不用输入密 阅读全文
posted @ 2022-10-15 16:41 Mrzxs 阅读(492) 评论(0) 推荐(0) 编辑
摘要:1.创建用户 (1)创建 默认用户为root,创建新用户用:create user ‘用户名’@‘IP地址’ identified by '密码'。 例如:create user ‘XXX’@‘192.168.43.1’ identified by '111111';(用户为XXX,密码为11111 阅读全文
posted @ 2022-08-22 09:45 Mrzxs 阅读(5847) 评论(0) 推荐(0) 编辑
摘要:场景:利用Mybatis向mysql中插入数据时,出现中文乱码 思想:猜测是url出现问题 原因: 第①步:在db.properties中的写法是 db.driver=com.mysql.jdbc.Driver#如果是mysql8.0+那么使用db.driver=com.mysql.cj.jdbc. 阅读全文
posted @ 2021-09-01 10:57 Mrzxs 阅读(637) 评论(0) 推荐(0) 编辑
摘要:url=jdbc:mysql: //localhost:3306/shop?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8 username=root passw 阅读全文
posted @ 2021-06-21 15:34 Mrzxs 阅读(302) 评论(0) 推荐(0) 编辑
摘要:mysql中 char和varchar 哪个效率高 char效率高! varchar更省空间 如: char(20) varchar(20) 存张三 |char:张三000000000000000000(17个0) |varchar:张三(只存张三) 因为存char时不需要考虑空间,直接20个字符 阅读全文
posted @ 2020-09-25 08:38 Mrzxs 阅读(652) 评论(0) 推荐(0) 编辑
摘要:1.Data truncation: Data too long for column 'userid' at row 1具体错误如下: 解决方案: You have three choices to fix this.(stackOverflow的解决方法:) 1. Increase the si 阅读全文
posted @ 2020-09-16 21:32 Mrzxs 阅读(309) 评论(0) 推荐(0) 编辑
摘要:1.MySQL的复制相同表结构方法: 1)create table table_name as select * from table1 where 1=2 (或者limit 0); 2) create table table_name like table1_name; 二者的用途: as :用来 阅读全文
posted @ 2020-07-08 15:45 Mrzxs 阅读(549) 评论(0) 推荐(0) 编辑
摘要:java.lang.ExceptionInInitializerError at demo.Demo.test1(Demo.java:15) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.N 阅读全文
posted @ 2020-04-25 12:16 Mrzxs 阅读(1181) 评论(1) 推荐(0) 编辑
摘要:命令:create user 'username'@'host' identified by 'password'; //此行画红线的地方不能有空格 说明:username:你将创建的用户名host:指定该用户在哪个主机上可以登陆,如果是本地用户可用localhost,如果想让该用户可以从任意远程主 阅读全文
posted @ 2020-04-10 21:55 Mrzxs 阅读(179) 评论(0) 推荐(0) 编辑
摘要:如果出现这种问题那么是因为没有打开这个文件,如果想导入这个文件需要到开这个文件,然后再导入 阅读全文
posted @ 2019-04-20 00:27 Mrzxs 阅读(895) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
more_horiz
keyboard_arrow_up dark_mode palette
选择主题