. mysql Tutorial
Download the MySQL for Linux RPM package on the following page
http://www.mysql.com/downloads/down...3.52-1.i386.rpmhttp://www.mysql.com/downloads/down...3.52-1.i386.rpm
Save to/home/tmp Directory
List of commands:
My php4 and MySQL packages are php-4.0.1pl2-win32.zip, Mysql-3.23.19-beta-win.zip. Install MySQL first, use winzip8.0 to open the package for full installation, the default installation path is: C:mysql;When the installation is complete, open "run"
In general, use the MySQL in query to write this
The code is as follows
Copy Code
SELECT *From ' Tb_require 'WHERE ' require_id 'In (23, 1024)
This method is generally suitable for numeric types, and if it is a
Mysql> SELECT * from pet WHERE name like "b%";
To find the name ending with "FY":Mysql> SELECT * from pet WHERE name like "%fy";
To find the name that contains a "w":Mysql> SELECT * from pet WHERE name like "%w%";
To find names that contain
Optimization method of MySQL database program1, select the most applicable field properties
MySQL can support a large amount of data access, but generally speaking, the smaller the table in the database, the faster the query executed on it.
When you use SQLyog to export a dedecms database as a xxx.sql file, several errors are reported:
Error 1064 online 21: You have an error in your SQL syntax. Check manual t hat corresponds to your MySQL server version for correct syntax, use near '
1. Storage required for numeric type column types TINYINT 1 bytes SMALLINT 2 bytes mediumint 3 bytes INT 4 bytesInt (m) in the integer data type, m represents the maximum display width.in int (m), the value of M has nothing to do with how much
Problem phenomenon:
The day before yesterday to the MySQL database migration operations, B Machine (new) of the MySQL and a machine version of different, for the convenience of B machine installed MySQL directly copy a machine's data directory
After installation Lnmpa slowly focus on optimization, the first is to delete the MySQL log, delete mysql-bin.0000* similar files look irritable.View Source code Printing HelpLogin
The code is as follows
Copy Code
1. Calculating age
If you have a person's birthday and need to calculate the age of this person, replace the @dateofbirth in the following statement with a birthday
The code is as follows
Copy Code
SELECT Date_format
Start Navicat software, use "link" to connect MySQL database, before use, please ensure that the firewall can pass
Then pop up, random up a "connection name"; enter "host name/IP" Here, fill in the MySQL database server IP address, username
In MySQL, there are several statements in the following control process:1) Case
The code is as follows
Copy Code
Below'll return zeroSELECT case 0 if 0 THEN ' zero ' when 1 THEN ' one ' ELSE ' no one ' end;Below'll
A simple example
1.1. Create a table:
CREATE TABLE T (S1 integer);
1.2. Triggers:
The code is as follows
Copy Code
? delimiter |Create trigger T_trigger before insert on t for each rowBegin Set @x = "Hello
Although the latest MySQL installation files with MySQL Workbench, you can easily model and generate a database, but the word of mouth best database modeling tools or Sybase powerdesign, so that we can easily model once, Sihai into a library.Here's
MySQL uses multiple statements in the exception handling section of a stored procedure--Create a test table without any datadrop table if exists t;CREATE TABLE t (id int);--Create a stored proceduredrop procedure if exists test;Delimiter |CREATE
1005: Failed to create table1006: Failed to create database1007: Database already exists, failed to create database1008: Database does not exist, delete database failed1009: Unable to delete database file causes database failure to be deleted1010:
Copy the table in MySQL and copy the Old_table table to the New_table table.
1. Do not copy table data, only copy structure.
The code is as follows
Copy Code
CREATE TABLE new_table like Old_table2
. By a
The online business uses the ORM framework, and discovers a slow query SQL that has been sorted two times in the same field, resulting in filesort. The ORM Framework has its own table structure as follows:
CREATE TABLE ' Unopen ' ( ' Corp '
Asp tutorial. net Tutorial and mysql tutorial database tutorial connection method and instance codeMySQL database is a low-cost MySQL SQL Server database, and canEasy-to-use network applications, including ASP. NET projects. Connect to MySQL from
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