Category:MySql

  • Summary of MySQL hacked and security measures

    Time:2020-1-22

    Situation overview Today, I log in to the MySQL database built on Tencent ECs and find that the database has been hacked. The hacker‘s prompt is very obvious. There are only two databases left in mysql, one isinformation_schema, the other is created by hackersPLEASE_READ, one of theminfoTable, contents as follows: Info: Your DB is Backed […]

  • Are you still in select *?

    Time:2020-1-22

    There are many reasons for the slow application, such as network, system architecture and database. So how to improve the execution speed of database SQL statements? Some people will say that performance tuning is the business of database administrators (DBAs), but performance tuning has a lot to do with programmers. If you use some optimization […]

  • Database 2

    Time:2020-1-21

    Database 2 > > > MySQL storage engine introduction MySQL basic data type Integrity constraints of MySQL tables A preliminary understanding of MySQL database Mysql database table detailed operation The execution order of MySQL’s logical query statements MySQL single mark query MySQL multi table query MySQL exercises and answers

  • Explain how an SQL statement is executed in MySQL

    Time:2020-1-21

    overview Recently, I began to learn the related knowledge of MySQL. According to the knowledge I learned, I sorted and shared it according to my understanding. This article will analyze the execution process of the next SQL statement in mysql, including how the query of SQL will flow in mysql, and how the update of […]

  • SSM (Spring + springmvc + mybatis) framework integration

    Time:2020-1-19

    1. Data preparation SET FOREIGN_KEY_CHECKS=0; — —————————- — Table structure for `admin` — —————————- DROP TABLE IF EXISTS `admin`; CREATE TABLE `admin` ( `a_id` int(11) NOT NULL AUTO_INCREMENT, `a_name` varchar(20) NOT NULL, `a_pwd` varchar(20) NOT NULL, PRIMARY KEY (`a_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; — —————————- — Records of admin — —————————- — —————————- — Table […]

  • Import and backup between MySQL database and Oracle Database

    Time:2020-1-19

    Import the data exported from Oracle database into MySQL database 1. Use the default end symbol to import into the MySQL database: LOAD DATA LOCAL INFILE ‘d:/oracle.txt’ IGNORE INTO TABLE alarmLog At this time, the default ending character of fields is’ / T ‘tab, not’ / T ‘string 2. When the fields terminator is set […]

  • PT online schema change tool tutorial (modify large table structure online)

    Time:2020-1-18

      Installation and use of Pt online schema change tool in percona Toolkit Introduction to PT online schema change Usage scenario: modifying large table structure online In the maintenance of database, it always involves the modification of table structure in the production environment. The modification of some small tables has little impact, while the modification […]

  • Analysis of using JDBC to operate MySQL requires adding class. Forname (“com. Mysql. JDBC. Driver”)

    Time:2020-1-18

    Introduction If you are familiar with using JDBC to connect to the database, you must know that there must be a basis for class.forname in the code to connect to the database (“com.mysql.jdbc.Driver”); public static Connection getConnection() throws ClassNotFoundException, SQLException { if(connection == null){ Class.forName(“com.mysql.jdbc.Driver”); connection = DriverManager.getConnection(“jdbc:mysql://localhost:3306/xxx?serverTimezone=UTC”, “root”, “xxxxxx”); } return connection; } I […]

  • Download, install and configure mysql-5.7.28 under Windows

    Time:2020-1-17

    You need to change the version of MySQL database recently. Write an article and record it 1、 Download MySQL database There are two kinds of MySQL downloads, one is zip compressed file, the other is MSI installerOfficial version 5.7 zip file download pageOfficial version 5.7 MSI installer download page I choose 5.7.28-windows 64 bit Click […]

  • The implementation of regular backup of MySQL database

    Time:2020-1-17

    1. Create a shell script vim backupdb.sh Create the script as follows: #!/bin/sh db_user=”root” db_passwd=”123456″ db_name=”userdb” name=”$(date +”%Y%m%d%H%M%S”)” /usr/bin/mysqldump -u$db_user -p$db_passwd $db_name >>/home/backup/$name.sql Explain: /Usr / bin / mysqldump: the path of mysqldump backup tool under the MySQL database installation directory Dbname: the name of the database to be backed up /Home / backup / […]

  • Modify MySQL database data file path under Linux

    Time:2020-1-16

    After installing MySQL database by rpm, the default path of data file is / var / lib / MySQL, but the root directory is not suitable for storing data files. Original path: var / lib / MySQLTarget path: / home / mysql_data / MySQLLinux system version: CentOS 7.6Mysql database version: 5.7.25 Steps:1. Create target path […]

  • The use of MySQL unique key in query and related problems

    Time:2020-1-16

    1. Create table statement: CREATE TABLE `employees` ( `emp_no` int(11) NOT NULL, `birth_date` date NOT NULL, `first_name` varchar(14) NOT NULL, `last_name` varchar(16) NOT NULL, `gender` char(1) NOT NULL, `hire_date` date NOT NULL, PRIMARY KEY (`emp_no`), UNIQUE KEY `idxunique_first_name_gender` (`first_name`,`gender`), UNIQUE KEY `uniq_idx_firstname` (`first_name`,`gender`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 2. Add unique key: –Add unique index alter […]