Mysql commands commonly used in operation and maintenance

1. Check which libraries are available > show databases; 2. View the table of a library > use db1; show tables; 3. View the fields of the table > desc tb1; 4. View the statement of table creation > show create table tb1; 5. Which user is it currently > select user(); 6. View the current library > select databa ...

Posted on Wed, 01 Apr 2020 09:42:57 -0700 by phil88

easyui authentication extension

Problem Description: As shown above: when users add information, they must ensure that a team can only have one piece of data a day. Therefore, when the report date is selected, you must query whether the data of the current team in the database exists. If it does not exist, i.e. the current date team has no data, data can be added; otherwise, ...

Posted on Wed, 01 Apr 2020 09:11:13 -0700 by mmponline

Preload of sequenize

Preloading When you retrieve data from a database, you also want to get the query associated with it, which is called preloading. User.findAll({ include: [{ model: Tool, as: 'Instruments' }] }).then(users => { console.log(JSON.stringify(users)) /* [{ "name": "John Doe", "id": 1, "created ...

Posted on Tue, 31 Mar 2020 14:18:04 -0700 by mattw

Using pymongo to operate the database

Using pymongo to connect to the database Connect mongodb #!/usr/bin/env python # -*- coding:utf-8 -*- from pymongo import MongoClient conn = MongoClient('192.168.0.113', 27017) db = conn.mydb #Connect to mydb database, if not, it will be created automatically my_set = db.test_set  #Use the test set collection, otherwis ...

Posted on Tue, 31 Mar 2020 12:32:13 -0700 by m@ndio

nodejs asynchronous to synchronous

When the project is developed in wechat environment, it needs to obtain access_token for authorized login and user information. Specially take this function out to encapsulate a custom module module.exports = new Wechat(con.appid, con.secret, con.url); appid and secret were written dead before the local configuration file, and later the syste ...

Posted on Tue, 31 Mar 2020 08:34:50 -0700 by pkellum

3.21 study database design of python operation database authority system

pip3 download pymysql Python operation Mysql #pypi inside pip3 install pymysql 2. Use pymysql def yanga11ang(): #------------------1. Execute SQL--------------------------- import pymysql # Create connection conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='654321', db='t1',charset='utf8') # ...

Posted on Tue, 31 Mar 2020 07:04:26 -0700 by Errant_Shadow

Prevent storage XSS attacks

XSS attack is a cross site script attack, which is divided into storage type and reflection type. The storage XSS attack is to store the attack script to the database, so that all visitors will be attacked. The attack script will generally send the user's cookie to the attacker, and then the attacker forges the user's login. The reflective XSS ...

Posted on Tue, 31 Mar 2020 06:20:06 -0700 by flash-genie

Invalid ThinkPHP multi table rollback

Today, for the first time, we used multi table rollback and encountered a pit. The error code is as follows: try{ $Member = D("Member"); $Member->startTrans(); $member_condition['id'] = 11641; $member_data['id'] = 10000; $member_res = $Member->where($member_condition)->save($member_data); if ...

Posted on Tue, 31 Mar 2020 00:19:34 -0700 by abhijeet

On the use of dtle in data transmission

Author: Ma yingle A member of the research and development team of akesheng, responsible for the testing of mysql middleware and database management platform. Good at finding fault (testing technology enthusiasts), welcome to try dtle~ Source: original contribution *Aikesheng is produced by the open source community. The original content can ...

Posted on Mon, 30 Mar 2020 02:53:10 -0700 by Crysma

Hibernate (III) openSession and getCurrentSession

1, OID, HQL, SQL, QBC operations 1.1 ibernate has four operation modes, namely OID, HQL, QBC and SQL.   OID: object identifier. Hibernate is used to mark the unique object. In fact, it is the primary key Available operations: add, delete, modify and query For example, we often use save, update, delete, get, load, saveOrUpdate and other m ...

Posted on Sun, 29 Mar 2020 11:52:57 -0700 by buddhika2010