First, MySQL installation steps1. Check if MySQL is installed on your Linux systemsudo service MySQL start2. Install MySQL server, core programsudo apt-get install Mysql-server3. Install the MySQL clientsudo apt-get install mysql-clientDuring
The stored procedure: the Declaration and assignment of a variable.CREATE PROCEDURE P1 ()Begindeclare age int default 18; set age :=age+20;select age from dual;EndCalling the stored procedure: Call P1 (); The result is as follows:Second, the
Three Mysql1. Uninstalling the MySQL RPM packageRPM-E MySQL--nodeps2. Install the CMake packageTar zxf cmake-2.8.6.tar.gzCD cmake-2.8.6./configureGmake && gmake Install3. Create database program accounts and groupsGroupadd
1 MySQL statement execution user login and management2 3Mysql-Uroot-P-hlocalhost Test4 # Specify Login Test Database5 6Mysql-Uroot-P-Hlocalhost Company-EdescBook ; "7 # Log in to the company database to perform a single view of the Book table
To manipulate the contents of a database table:--insert data into the table:INSERT INTO TABLE_NAME values (now (), ' a ');INSERT into student (Id,name,sex) VALUES (1, ' Zhangsan ', ' nan ');--insert multiple records into the tableINSERT into student
1. Https://serverfault.com/questions/490656/mysql-not-starting-error-usr-sbin-mysqld-unknown-option-query-cache-si4down VotefavoriteI have a big problem.I try to start MySQL in Ubuntu, Buti has this error:130323 0:13:55 [Note] Plugin ‘FEDERATED‘ is
caused by inconsistent codingAlthough most of the exports are not problematic, the problem occurs when the data table stores some scripts (Rich text content), forcing the specified encoding to be resolved.Specify the encoding when MySQL
1.int Sub-query trapsTitle : In the Ecshop Mall table, query 6th items, (note, number 6th is a large column)Most intuitive : mysql> Select Goods_id,cat_id,goods_name from goods where cat_id in (select cat_id from ecs_c Ategory where parent_id=6);
first, the definition of the cursor:CREATE PROCEDURE P12 ()BeginDECLARE row_name varchar (20);declare row_num int;Declare mycursor cursor FOR select Name,num from goods;//defining cursors MyCursorOpen mycursor;//cursor MyCursorFetch mycursor into
The ideal Index
Frequent queries
High degree of differentiation
Small length
Try to overwrite common query fields
Indexing and sorting
When querying directly on an index for overwriting an index, there is a
Btree Index and Hash Index (index is a data structure that improves query, sorting, grouping speed)
Btree index data structure is balanced binary tree, time complexity of LGN
Hash index data structure is a hash function, time complexity
To optimize a query, we need to know exactly where this query's performance bottleneck is, is it consuming too much CPU, or does it require too many IO operations? To be able to understand this information clearly, in MySQL 5.0 and the MySQL 5.1
Of course, to solve the problem, we have to have the environment first.A master one from the configuration flow:Main: Configure DNS resolution first, the experimental environment can use/etc/hosts parsingVim/etc/hosts192.168.122.45 Master1192.168.122
Common MySQL error codes and codes
MySQL common error code and code Description
1005: An error occurred while creating the table.
1006: database creation failed
1007: the database already exists. An error occurred while creating the database.
1008:
How to reset the Root password for Mac MySQL
Note: You can reset the password of MySQL installed in Homebrew directly. For MySQL installed in other ways, you need to switch the corresponding installation directory.
After installing MySQL for a long
MySQL optimization: three simple minor adjustments to optimize mysql Adjustment
I don't want to be an expert DBA, But when I optimize MySQL, I respect the 80/20 principle, specifically by simply adjusting some configurations, you can squeeze out
Usage of MySQL CONCAT () and mysqlconcat
Reprinted on https://www.cnblogs.com/aiyr/p/6830593.html
The mysql CONCAT () function is used to connect multiple strings into one character string. It is one of the most important mysql functions. The
Mysql index,
Index name: you can create an index on multiple columns. This index is called composite index (Composite Index) (composite index)
I. Create an indexCreate table t1 (id int primary key, username varchar (20), password varchar (20
MySQL database index OverviewI. Meanings and features of indexes are independent and stored on disks.Database StructureThey includeReference pointer of all records in the data table. The index is used to quickly find rows with a special value in one
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