MySQL study NOTE 4: integrity constraints Field

Integrity constraints are imposed on fields to meet the expected results of the field. For example, a field contains a default value and cannot be NULL.Directly speaking, if the inserted data does not meet the restrictions, the database management

How to create an index in mysql

1. Add the primary key (primary key index)Mysql> alter table 'table _ name' add primary key ('column ')2. add UNIQUE (UNIQUE index)Mysql> alter table 'table _ name' add unique ('Column')3. Add an INDEX (Common INDEX)Mysql> alter table 'table _ name'

Usage of mysql initial execution File

You can specify the SQL file initially executed after mysql is started in the configuration file. Its syntax is:In [mysqld] or [server], specify:Init-file = D: \ mysql-5.5.28-winx64 \ abc. SQL, followed by the specific SQL file valuePay attention to

How to install MySQL 5.5 in CentOS 5.5

Open Terminal Switch to the root directory[Shell @ localhost ~] # Su-uninstall Mysql5.0 from CentOS before installing Mysql5.5.[Root @ localhost ~] # Yum remove mysqlInstall cmake Download the cmakesource code package cmake-2.8.5.tar.gz[Root @

Sample MySql Stored Procedure exception handling code sharing

The following is the sample code. When an exception occurs, the exception information is stored in the log table and the subsequent statements are run.If you have better suggestions, please kindly advise.Example of handling Stored Procedure

Mysql Out of memory (Needed 16777224 bytes) Error resolution

This error occurs in the past few days.I still don't know if these values are correct solutions. Post it first.If I haven't updated it for a while, please refer to it later.Out of memory (Needed 16777224 bytes) Error resolutionLook at the

Mysql database master-slave Configuration

Mysql Master/Slave configuration note: There are four machines in total: A (10.1.10.28), B (10.1.10.29), C (10.1.10.30), and D (10.1.10.31 ).After the configuration result: the A-C is the master and slave, B is the slave of A, D is the slave of C.0)

How to quickly insert large data volumes in MySQL and optimize statements

Locking also reduces the overall time for multi-connection testing, although the maximum wait time for them to wait for locking will increase. For example:Copy codeThe Code is as follows:Connection 1 does 1000 insertsConnections 2, 3, and 4 do 1

Detailed explanation and recommended configuration of MySQL database server core parameters

The MySQL Manual also provides server-side parameters and parameter value descriptions. Currently, we need to pay attention to the server-side parameters that need to be modified or affect performance, it takes a lot of time to explain its usage and

Converting MySQL from MyISAM to InnoDB errors and Solutions

Later, I was working on WordPress. I didn't know that WordPress was using the InnoDB Data Engine at the beginning, so I built a database in the original database. I didn't find any problems at the beginning, it's okay to import the SQL statement. I

Mysql inserts new data if the data does not exist. Otherwise, the update method is used.

// If no data exists, insert new data$ SQL = "INSERT INTO {$ ecs-> table ('cat _ lang ')} (cat_id, lang_id, cat_name, keywords, cat_desc)VALUES ({$ cat_id}, {$ k}, '{$ val ['cat _ name']}', '{$ val ['keyword']}', '{$ val ['cat _ desc']}')On

MySQL database recovery (using the mysqlbinlog command)

1: Enable binlog LoggingModify the mysql configuration file mysql. ini and add it under the [mysqld] node.Copy codeThe Code is as follows:# Log-binLog-bin = E:/log/logbin. log Do not include Chinese characters or spaces in the path. Restart the

How to Use the MySQL SHOW command

Show tables or show tables from database;Explanation: displays the names of all tables in the current database.Show databases;Explanation: displays the names of all databases in MYSQL.Show processlist;Explanation: displays all processes running in

Query the decode effect of a mysql-like oracle Database

The following code passes the test in MYSQL. MSSQL should be able to run without testing.Copy codeThe Code is as follows:# Create a table as followsCreate temporary table tmp (a int, B int, c int );Insert into tmp VALUES (10,100, 1), (, 2), (, 2 );#

InnoDB: Error: log file./ib_logfile0 is of differe

If your configuration file uses a configuration file like a my-innodb-heavy-4G.cnf.Mysql can be started normally, but innodb tables cannot be used.The following output is displayed in the error log:InnoDB: Error: log file./ib_logfile0 is of

Share data migration stored procedures in mysql

Copy codeThe Code is as follows:DELIMITER $USE 'servant _ 591up' $Drop procedure if exists 'SP _ move_data '$Create procedure 'SP _ move_data '()BEGINDECLARE v_exit int default 0;DECLARE v_spid BIGINT;DECLARE v_id BIGINT;DECLARE I INT DEFAULT

A summary of MYSQL table optimization methods is comprehensive.

At the same time, the online access volume continues to increase. For servers with 1 GB of memory, the server even crashes every day or gets stuck from time to time. This problem has plagued me for using MySQL for more than half a month. scalable

MySQL random password Generation Code

Copy codeThe Code is as follows:DELIMITER $CREATEFUNCTION 't_gir'. 'func _ rand_string '(f_num tinyint unsigned, f_type tinyint unsigned)RETURNS varchar (32)BEGIN-- Translate the number to letter.-- No 1 stands for string only.-- No 2 stands for

MYSQL random extraction implementation method and Efficiency Analysis

Copy codeThe Code is as follows:How can I read 15 records randomly from the database?Order by rand () limit 0, 15How to read all records randomly from the database?Order by rand ()However, I checked the MYSQL official manual. The prompt for RAND ()

MySQL/Postgrsql detailed instructions on how to use the ODBC interface to access MySQL Guide

How to access MySQL through ODBCMySQL ODBC interface is implemented by installing the MyODBC driver, which is cross-platform. For Linux and other Unix operating systems, install the third-party ODBC standard support platform, such as Iodbc.Simple

Total Pages: 3233 1 .... 2857 2858 2859 2860 2861 .... 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.