After a table is divided into n tables, how can I query the data of all the table type = 1?
(a user table, divided into 10 tables, I want to fetch all user type = 1 data)
Reply content:
After a table is divided into n tables, how can I query
Environment
MySQL 5.1 + command line tool
Problem
MySQL table field settings Default Value
Solution
-- SQL:
Create table test (I _a int NOT NULL DEFAULT 1,Ts_ B timestamp NOT NULL DEFAULT NOW (),C_c char (2) not null default '1');
-- The
Mysql table fragmentation cleaning, Mysql fragmentation cleaning
Mysql has recently declined in the production environment, and some SQL statements are also slow. First, check whether the slow query log is enabled.Show variables like 'slow _
The structure of the Mysql table is InnoDB and data is restored from the ibd file. innodbibd
The customer's machine system is shut down abnormally. After the restart, the mysql database cannot be started normally. After the system is reinstalled,
When I added a primary key to a Mysql table, I used the following SQL statement:
Alter Table'Table name'Add Column'Column name'Int Not NullAuto_increment comment'Primary key'Before 'a column name ';
The following two errors are returned:
Error
Use Shell scripts to convert MySQL table data to json format, mysqljson
The script is as follows:
#!/bin/bashmysql -s -phello test >1.log
The data in table t1 is as follows:
mysql> select * from t1;+------+-------+| id | name |+------+-------+|
Mysql table sharding Based on MRG_MyISAM engine, mrg_myisammysql
Under normal circumstances, all sub-tables directly create multiple tables with the same structure, such as table_1 and table_2... recently, we encountered a special requirement that
Replication between mysql tables, the same database and different databases, mysql table replication Database
Mysql statement
We can first export the structure of table t1 under test, and then create a new table test1.t1.
Execute the following
Basic Mysql table operations and basic mysql operations
1. Create a table
Syntax: create table Name (
Complete constraints on the Data Type of the attribute name,
Complete constraint for data type entry of attribute name,
.........
Attribute name
Some fields in mysql tables do not support Chinese characters. for example, I directly modify a field in a mysql table, and the entered Chinese characters are changed ??, However, it is normal to modify some fields in Chinese in another table in the
How to create an associated mysql table-PHP, which is usually used for single-table operations, has never made any progress. recently, after reading a few open-source articles, it has become more dynamic.
Books and videos that have been read all
MySQL table column replication, MySQL connection time and memory control.
There are two table temporary table temp_t, and the positive table table1, are MyISAM, respectively, there are about 28W records.
Cron periodically fetches some information
MySQL table in the "latest" three Days of record, SQL statement how to write
MySQL takes the
last three days of records in the table, and how the SQL statements are written. Checked from the Internet, but this is the
current time as the starting
Error reading data from MySQL table
Here's a piece of code that works fine
/* Inject basic information, a_i automatically generate META_ID */$query 1 = "INSERT into Libr_metacode (META_ISBN, Meta_cip) VALUES (' $isbn ', ' $cip ')";$result 1 =
MySQL table changed the code, statement execution on the error
I changed the form and field code from UTF8_GENERAL_CI to Utf8_unicode_ci, and I got an error.
Warning:mysql_num_rows (): supplied argument is not a valid MySQL result resource
Write a php file, automatically cycle to create MySQL table, 20 points both hands
Write a php file, automatically cycle to create MySQL table, 20 points both hands
Table name definition: table20100531,table20100601,table20100602....................
Document directory
Data Table portability
Mysql Data Tables support six types: bdb, heap, isam, merge, MyISAM, and innobdb.
These six types are divided into two categories: Transaction-safe, including bdb and InnoDB, And the other are in the
Objective
1, this method only describes how to save the table name (data does not recover) if you want to restore the original data directly with Extundelete to restore the file back to the
2, and is applicable to usually not fully prepared in the
Using the old version of the MySQL client navicate 8, the MySQL server with the mysql5.6 version, in the revision of the engine version of the version is not correct;
MySQL error ' Type=myisam '
Solution:
Replace
Type=myisam
With
Engine=myisam
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.