Differences between char and varchar in mysql

Differences between char and varcharChar (13) is fixed in length. For example, the storage space of 'www .jb51.net' must be 12 characters long.Varchar (13) Variable Length: for example, 'www .jb51.net' requires a bucket of 13 characters,From the

Common mysql maintenance commands

Analyze Table When optimizing SQL statements, MySQL Optimizer must first collect related information, including the cardinality of the table (which can be translated as "hash degree "), it indicates the number of different values in the column

Implementation statement for inserting data from one table into another table in MySQL

If the fields of the two tables are consistent and you want to insert all the data, you can use this method:Code:Copy codeThe Code is as follows:Insert into target table SELECT * FROM source table; For example, to insert the articles table to the

How many columns does a MySQL index have? Real test example

Up to 16 columns.Create table test (F1 int,F2 int,F3 int,F4 int,F5 int,F6 int,F7 int,F8 int,F9 int,F10 int,F11 int,F12 int,F13 int,F14 int,F15 int,F16 int,F17 int);Create index idx_test_16 on test (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12,

MySql adds user, authorization, password modification, and other statements

1. Create a user. // Log on to MYSQL@> Mysql-u root-p@> Password// Create a userMysql> insert into mysql. user (Host, User, Password, ssl_cipher, x509_issuer, x509_subJect) values ("localhost", "pppadmin", password ("passwd "),'','','');In this way,

CMS does not make MySQL cry for you

How much data does MySQL support? In fact, the upper limit of a single MySQL table is mainly related to the maximum file size supported by the operating system. Let's take a look at the official introduction.1.4.4. Maximum number of MySQL

Common MYSQL commands and practical skills

1. Connect to MYSQL.Format: mysql-h host address-u user name-p User Password1. Example 1: connect to MYSQL on the local machine.First, open the DOS window, enter the directory mysqlbin, then type the command mysql-uroot-p, and press enter to prompt

MYSQL select Study Notes

Record some select tips:1. select statements can be separated by carriage return.$ SQL = "select * from article where id = 1"And $ SQL = "select * from articleWhere id = 1 "can get the correct results, but sometimes it is clearer to write separately,

Performance Comparison Test of MyISAM and InnoDB table storage structures in MySQL

MySQL supports two main table storage formats: MyISAM and InnoDB. InnoDB was used for a project last month. The results are very slow and only a dozen pieces can be inserted in one second. Later I changed to MyISAM format and inserted tens of

How to change the password and access restrictions in MySQL

Because of its openness and Stability of the source code, and its perfect combination with the popular compilation of PHP, many websites now use it as a back-end database, making it widely used. In terms of security, each user must be given access

How to add new user permissions in MySQL

There are two different ways to add users: using the GRANT statement or directly operating the MySQL authorization table. The better way is to use the GRANT statement, because they are more concise and seem to have fewer errors.The following example

How to obtain the number of occurrences of a long string in SQL

How to obtain the number of occurrences of a long string in SQLFor example, there is a string: X-BGS-2010-09-15-001 I want to know the number of occurrences of '-', which can be implemented using the following method without complex one-Character

The difference between on and where in left_join and inner_join in SQL statements

Table a (id, type ):Id type----------------------------------1 12 13 2Table B (id, class ):Id class---------------------------------1 12 2SQL statement 1: select a. *, B. * from a left join B on a. id = B. id and a. type = 1;SQL statement 2: select

How to change the storage location of a Mysql database

1. Stop mysql services first.2. Change the master path of database storage in MySQL configuration file My. iniOpen the default MySQL installation folder C: \ Program Files \ MySQL Server 5.1 In my. INI file, click "edit" and "Search" at the top of

Efficient mysql paging method and principle

First, let's take a look at the basic principles of paging:Copy codeThe Code is as follows:Mysql> explain SELECT * FROM message order by id desc limit 10000, 20G ******************* 1. row ************** id: 1 select_type: SIMPLE table: message type:

In-depth analysis of MySQL database backup and restoration in Linux

In-depth analysis of MySQL database backup and restoration in Linux 1. Backup[Root @ localhost ~] # Cd/var/lib/mysql (go to the MySQL database directory and adjust the directory based on your MySQL installation)[Root @ localhost mysql] # mysqldump-u

Three methods of mysql backup

I. Purpose of backup Disaster recovery: recover and restore damaged dataDemand change: data needs to be restored to a time before the change due to demand changesTest: test whether the new function is available Ii. Backup considerations How long

MYSQL binary solves the case sensitivity problem of mysql Data

Copy codeThe Code is as follows:Mysql> select binary 'abc' = 'abc' COM1, 'abc' = 'abc' COM2;+ -------- + ----------- +| COM1 | COM2 |+ -------- + ----------- +| 0 | 1 |+ --------- + ----------- +1 row in set (0.00 sec) (Just a few! 4. *

How to ignore duplicate data when inserting MYSQL Data

When using the following two methods, the field must be set to "primary key" or "UNIQUE constraint (UNIQUE )".1: Use replace into (This method uses the replacement method, which is a bit similar to deleting and then inserting)Copy codeThe Code is as

Check and fix mysql database tables

01#! /Bin/sh02# Code by scpman03# Function: Check and fix mysql database tables04# Add the script to the timer. When the script is executed, it will read the database, list all the tables to be repaired, timing them, and start fixing.05# The damaged

Total Pages: 3233 1 .... 2858 2859 2860 2861 2862 .... 3233 Go to: GO

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.