When LEFT JOIN joins a table, the multi condition is invalid after ON
/**Create table **/
/**Create table 1**/
CREATE TABLE `product` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`amount` INT(10) UNSIGNED DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
/**Create table 2**/
CREATE TABLE `product_details` (
`id` INT(10) UNSIGNED NOT NULL,
`weight` INT(10) UNS ...
Posted by BillyMako on Sat, 02 Nov 2019 10:26:29 -0700
mysql is backed up regularly under linux, and the data storage cycle is one week
The following script is from the network, and the copyright belongs to the original author (it is recommended to automatically back up at night, and use cron to plan tasks)
#!/bin/bash
#Save the number of backups and backup the data for 7 days
number=7
#Backup save path
backup_dir=/var/erp/data/mysql
#date
dd=`date +%Y-%m-%d-%H-%M-%S ...
Posted by azwebdiva on Sat, 02 Nov 2019 09:41:23 -0700
Technology sharing | MySQL's join | buffer | size application on internal connection
Author: Yang Taotao
This article introduces the use of MySQL parameter join ﹣ BUFFER ﹣ size in the INNER JOIN scenario, which is not included in OUTER JOIN. Before discussing the BUFFER, let's first understand the INNER JOIN classification of MySQL.
If it is subdivided according to the retrieval performance, whether it is two or more inner jo ...
Posted by deckrdx on Sat, 02 Nov 2019 08:03:18 -0700
Golang connection operation MySQL database
1. Install MySQL driver
Installation mode: open the command line and execute the go command:
go get -u github.com/go-sql-driver/mysql
2. Connect MySQL
To build a connection, the format is: "user name: password @ tcp(IP: port) / database? charset=utf8"
Open the database, the forme ...
Posted by sparc-e on Sat, 02 Nov 2019 05:38:08 -0700
Is last? Insert? Id() trusted
Guide reading
Usually, we call last? INSERT? Id() to get the latest auto increment ID after executing an INSERT, but this is not very reliable.
When the last INSERT id() function has no additional parameters or expressions, it returns an unsigned BIGINT. By default, it returns the value after the last INSERT of the au ...
Posted by ahs10 on Sat, 02 Nov 2019 05:34:45 -0700
Java uses thread pool to insert or update data in batches
Requirements: when developing business reports, it is necessary to read data from MySQL database, then write it to the database, and run batches using scheduled tasks.
Analysis: ① considering performance; ② MySQL is not as convenient and powerful as Oracle. To sum up, thread pool is used to insert MySQL database in batch Submission Scheme. Thi ...
Posted by Kasuke_Akira on Sat, 02 Nov 2019 04:34:20 -0700
Microservice architecture case (03): introduction to database selection, business data planning and design
Source code: GitHub point here || GitEE point here
Update progress (6 sections in total):
01: brief introduction of project technology selection and schematic description of structure
02: business architecture design, system hierarchical management
03: database selection, business data design and planning
I. database selection
1. Database ...
Posted by nerotic on Sat, 02 Nov 2019 00:47:00 -0700
PHP operation Redis, primary PHP can't remember to operate several times
Basic operation methods of redis
1.redis Connections for:
//Instantiate redis
$redis = new Redis();
//Connect
$redis->connect('127.0.0.1', 6379);
//Check whether the connection is successful
echo "Server is running: " . $redis->ping();
// Output result Server is running: +PONG
2.redis operation Strng (string):
// Set the value of ...
Posted by the-hardy-kid on Sat, 02 Nov 2019 00:25:09 -0700
Install conference and decipher
Log in to liunx to get administrator permission
sudo -i
cd /home/maxiaolin
Install jdk
yum -y install java
java -version
Install mysql
Check if mysql is installed
rpm -qa | grep mysql
>>mysql-libs-5.1.73-7.el6.x86_64
Uninstall mysql
RPM - E -- nodes mysql-libs-5.1.73-7.el6.x86_ (the option you see) / / strong delete mode. If you use the a ...
Posted by psyion on Fri, 01 Nov 2019 23:38:32 -0700
Software environment required for Centos7 installation
Mysql installation
Download and install
Download and install MySQL's official Yum Repository
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
Yum installation source
yum -y install mysql57-community-release-el7-10.noarch.rpm
Install Mysql
yum -y install mysql-community-server
Set Mysql to power on
systemct ...
Posted by cgraz on Fri, 01 Nov 2019 19:37:48 -0700