Hongmu Notes
Home Language Notes mySql

mySql

MySQL is a relational database management system developed by the Swedish company MySQL AB and is part of the Oracle product family. It is one of the most popular relational database management systems; in web application scenarios, MySQL is one of the leading RDBMS (Relational Database Management System) application solutions.

Mysql efficiency improvement: limit this piece of shit

Mysql efficiency improvement: limit this piece of shit Language Notes mySql

In mysql, the efficiency of limit is not high, especially my millions of data, limit 100000, 50, so writing, the query is even slower, at first it was quite fast, and the server cup behind it was directly filled for me! I thought the server was hacked, so I looked for the problem. I looked for it for a few days, but it turned out to be this dog, which made me angry! So I inquired about the principle of limit, emmm, change! Must be changed ...
👁 155
sqlite uses PDO to execute SQL statements exec(), query()

sqlite uses PDO to execute SQL statements exec(), query() Language Notes mySql

In PHP scripts, executing SQL queries using PDO to interact with a database can be done through three different approaches; the choice of which method to use depends on the specific operation you intend to perform. 1. Using the PDO::exec() method: When executing queries such as INSERT, UPDATE, or DELETE that do not return a result set, use the exec() method on a PDO object to execute the query. Upon successful execution, this method returns the number of affected rows...
👁 323
Fix the id auto-increment sequence of data tables

Fix the id auto-increment sequence of data tables Language Notes mySql

1. Drop the existing primary key: `ALTER TABLE `table_name` DROP `id`;` 2. Add a new primary key field: `ALTER TABLE `table_name` ADD `id`INT(11) NOT NULL FIRST;` 3. Set the new primary key: `ALTER TABLE `table_name` MODIFY...`
👁 177
config database configuration and database connection

config database configuration and database connection Language Notes mySql

<?php define('DB_NAME', ''); define('DB_USER', ''); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define…
👁 176
SQL UPDATE statement updates a piece of data to the database

SQL UPDATE statement updates a piece of data to the database Language Notes mySql

UPDATE table name SET column name = new value WHERE column name = some value
👁 129
1 2