Discover rename table name in mysql, include the articles, news, trends, analysis and practical advice about rename table name in mysql on alibabacloud.com
When we create a table, we will inevitably think of it poorly, so we later modify the table modification table to use the ALTER TABLE statement
Modify Table name
Copy Code code as follows:
Label:MySQL reserved word list. Bark finishing.Attempting to use a qualifier, such as using an embedded MySQL data type or function name as a table or column name, such as timestamp or group, can cause a common problem. Allows you to do this (for example, ABS can be used as a column
Sp_rename N 'table name. Field name', 'new field name', 'column 'top
Sp_renameChange the name of the user-created object (such as a table, column, or user-defined data type) in the current database.SyntaxSp_rename [@ objname =] 'o
Table A has A field primary key, ID, name, and evaluation score. Table B has A field primary key, key, and description. the evaluation score corresponds to the key. then Table B is A status table (for example, there are data rows: Satisfied, general, negative rating) current
There may be a situation where you need an identical replica table create TABLE ... The select is not appropriate because the copy must contain the same index, default, and so on.
You can handle this situation by following the steps below.
Use show create table to get the structure, index, and so on of the specified source
much easier than creating a table.
1) delete a common table
[SQL]
Drop table table_name;
2) delete a temporary table
[SQL]
Drop temporary table table_name;
3) the table is deleted only when it exists.
[SQL]
Drop
); Alter Table varchar (ten);
Additional notes:
Data type is required, but can be a new "rename field can be changed by data type"
Renaming can also modify the data type, properties, and location of the field. "If the field has attributes, you can rename the field without the"
To delete a field:
Grammar:
Alter
that the two are associated. So the foreign key must be created from the table to find the connection to the primary table , and the table is responsible for maintaining the relationship between the two.We will first use the following command to create the department table and staff
MySQL field name conflicts with reserved words and the solution, mysql Field
Problem: Conflicts between MySQL field names and reserved words often occur in actual operations.
Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorException.
Solution: in
The purpose of modifying rename database by Information_schema information
MySQL does not have rename database command, can only modify the table in disguise to the table in the target library to achieve:
Stitching Reanme Tables Execution statements
[Emailp
MySQL study Note 5: modifying the table (altertable) bitsCN.com we will inevitably consider the week before creating the table. Therefore, the alter table statement is required to modify the table later.
Modify table
In the metering pump host computer software, you need to transfer data from the next computer, stored in the MySQL database, displayed in the Java host computer interface, and can be exported to the computer designated location.Select the storage path and file name: //menu for working with saved files Public voidexportexcelfile (String sql,string []paras) {string Absolutepath=""; //setting the style
MySQL adds, modifies, and deletes TABLE columns and constraints. TABLE definitions such as bitsCN. comALTER TABLE: adds, modifies, and deletes TABLE columns and constraints.
View column: desc table
In Linux: the default data file storage directory of MySQL is/var/lib/mysql. I want to do two things today: Change the Database Name (three methods are tested), and change the directory location of the MySQL database. Database rename: 1.
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 fo
divided into 100 tables. when 1 million users are browsing a single table, 1 million requests will be made, it is possible that 10 thousand data requests are performed for each table (because it is impossible to perform an absolute average, just assume), which reduces the pressure a lot.
Mysql sharding method: http://blog.csdn.net/heirenheiren/article/details/78
Analysis of Different errors in MySQL table sorting rules and mysql table sorting rules
MySQL multi-table join reports an error: [Err] 1267-Illegal mix of collations (utf8_general_ci, IMPLICIT) and (utf8_unicode_ci, IMPLICIT) for
Label: MySQL creates a table and creates a . frm file to save the table and column definitions. The index is stored in one . MYI (Myindex) and the data is stored in the . MYD (MYData) file extension. First, using Show/describe statement to display the data table information Grammar:SHOW TABLES [from db_name] [like wil
, MySQL allows you to replace change with the modify keyword. The only difference between the two is that change must specify the names of the new and old fields at the same time. Because modify can only be used to modify the field type, it cannot change the field name, therefore, there is no concept of a new field name./*
Change the ID in the nick_name
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.