mariadb

Aggregating data by date in a date range without date gaps in result set

房东的猫 提交于 2019-12-29 07:56:08
问题 I have a table with sell orders and I want to list the COUNT of sell orders per day, between two dates, without leaving date gaps. This is what I have currently: SELECT COUNT(*) as Norders, DATE_FORMAT(date, "%M %e") as sdate FROM ORDERS WHERE date <= NOW() AND date >= NOW() - INTERVAL 1 MONTH GROUP BY DAY(date) ORDER BY date ASC; The result I'm getting is as follows: 6 May 1 14 May 4 1 May 5 8 Jun 2 5 Jun 15 But what I'd like to get is: 6 May 1 0 May 2 0 May 3 14 May 4 1 May 5 0 May 6 0 May

Higher cardinality column first in an index when involving a range?

ⅰ亾dé卋堺 提交于 2019-12-28 18:14:26
问题 CREATE TABLE `files` ( `did` int(10) unsigned NOT NULL DEFAULT '0', `filename` varbinary(200) NOT NULL, `ext` varbinary(5) DEFAULT NULL, `fsize` double DEFAULT NULL, `filetime` datetime DEFAULT NULL, PRIMARY KEY (`did`,`filename`), KEY `fe` (`filetime`,`ext`), -- This? KEY `ef` (`ext`,`filetime`) -- or This? ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; There are a million rows in the table. The filetimes are mostly distinct. There are a finite number of ext values. So, filetime has a high

Higher cardinality column first in an index when involving a range?

北慕城南 提交于 2019-12-28 18:13:43
问题 CREATE TABLE `files` ( `did` int(10) unsigned NOT NULL DEFAULT '0', `filename` varbinary(200) NOT NULL, `ext` varbinary(5) DEFAULT NULL, `fsize` double DEFAULT NULL, `filetime` datetime DEFAULT NULL, PRIMARY KEY (`did`,`filename`), KEY `fe` (`filetime`,`ext`), -- This? KEY `ef` (`ext`,`filetime`) -- or This? ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; There are a million rows in the table. The filetimes are mostly distinct. There are a finite number of ext values. So, filetime has a high

CentOS 7安装MySQL

与世无争的帅哥 提交于 2019-12-28 14:19:26
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、准备安装文件 先去 官网 下载安装包,注意系统要选择RedHat 7 然后解压得到下边这些文件 二、开始安装 #删除mariadb的文件,不然会冲突 [iceberg@localhost mysql5.5]# sudo yum -y remove mariadb-libs [iceberg@localhost mysql5.5]# sudo rpm -ivh *.rpm warning: MySQL-client-5.5.62-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: perl(Data::Dumper) is needed by MySQL-server-5.5.62-1.el7.x86_64 perl(Data::Dumper) is needed by MySQL-test-5.5.62-1.el7.x86_64 方案: 安装 perl 和 自动配置 autoconf # 安装 perl [iceberg@localhost mysql5.5]# sudo yum install perl # 安装 autoconf 解决 perl(Data:

Connect to MariaDB from Java application in NetBeans on Linux (Mageia)

穿精又带淫゛_ 提交于 2019-12-28 12:34:33
问题 I am trying to connect to a database in Mariadb through a simple java application but the connection is told to be unsuccessful and an Exception is thrown. I have done the similar connection using mysql and it was working correctly. The problem is maybe with the driver here. try{ Class.forName("org.mariadb.jdbc.Driver"); Connection connection = DriverManager.getConnection( "jdbc:mariadb://localhost:3306/project", "root", ""); Statement statement = connection.createStatement(); String uname=

mysql service fails to start/hangs up - timeout (Ubuntu, MariaDB)

﹥>﹥吖頭↗ 提交于 2019-12-28 12:29:12
问题 I set up my first Ubuntu Server with Ubuntu 16.04, nginx, php7.0, MariaDB, nextcloud and external DynDNS using this tutorial here: Install Nextcloud 9 on Ubuntu 16.04 Everything worked fine but since I restarted the server the next day, nextcloud just shows me a blank page. After clicking through all logs of nginx, MariaDB and nextcloud, I found out that the mysql service just doesn't start. So run service mysql start and everything worked fine again (calling nextcloud from server as well as

mariadb启动失败解决办法

丶灬走出姿态 提交于 2019-12-28 12:20:14
mariadb启动失败 查看原因 systemctl status mariadb.service 打开mysql日志 vi /var/log/mariadb/mariadb.log 原因:mysql启动时,ib_logifle0文件大小 不正常, 查看ib_logifle0文件大小为0, 解决办法:将ib_logifle0文件删除,然后重新启动mariadb ,service mariadb start 来源: CSDN 作者: 来杯时光 链接: https://blog.csdn.net/weixin_38407447/article/details/88775765

MariaDb SQL Injection

断了今生、忘了曾经 提交于 2019-12-28 06:26:13
问题 I am trying to exploit (legally) a MariaDb database with an SQLi vulnerability. I have identified the vulnerability here... /?o=1&page=app The o=* is vulnerable and produces the following error... DEBUG INFO: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '5' or dest like '1'') LIMIT 10' at line 1 I am using Burp Suite and have landed upon the following syntax which seems to be closer to the mark but is

CentOS7下安装搭建Cacti

时光毁灭记忆、已成空白 提交于 2019-12-28 05:40:31
1.搭建lamp环境 配置apache [root@cacti-server ~]# yum -y install httpd [root@cacti-server ~]# systemctl start httpd [root@cacti-server ~]# systemctl enable httpd [root@cacti-server ~]# firewall-cmd --permanent --add-service=http success [root@cacti-server ~]# firewall-cmd --reload success 配置mariadb [root@cacti-server ~]# yum -y install mariadb-server mysql-devel [root@cacti-server ~]# systemctl start mariadb [root@cacti-server ~]# mysql_secure_installation Set root password? [Y/n] Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y

数值类型

☆樱花仙子☆ 提交于 2019-12-28 00:40:18
数值类型 1、整数类型 整数类型:TINYINT ,SMALLINT, MEDIUMINT ,INT,BIGINT 作用:存储年龄,等级,id,各种号码等 ======================================== tinyint[(m)] [unsigned] [zerofill] 小整数,数据类型用于保存一些范围的整数数值范围: 有符号: -128 ~ 127 无符号: 0 ~ 255 PS: MySQL中无布尔值,使用tinyint(1)构造。 ======================================== int[(m)][unsigned][zerofill] 整数,数据类型用于保存一些范围的整数数值范围: 有符号: -2147483648 ~ 2147483647 无符号: 0 ~ 4294967295 ======================================== bigint[(m)][unsigned][zerofill] 大整数,数据类型用于保存一些范围的整数数值范围: 有符号: -9223372036854775808 ~ 9223372036854775807 无符号: 0 ~ 18446744073709551615 验证 =========有符号和无符号tinyint==========