The code is as follows
Copy Code
$con = mysql_connect ("localhost", "root", "222222");if (! $con){Die (' Could not connect: '. Mysql_error ());}echo "Success"Mysql_close ($con); Close connectionVar_dump ($row); Print outPrint_r ();
1.IFNULL statement: Ifnull (EXP1, EXP2), return EXP2 if EXP1 is null, return EXP1 if not null
The code is as follows
Copy Code
mysql> SELECT ifnull (null, 100);+-------------------+| Ifnull (NULL, 100) |+---------------
The first two days when you encountered data recovering data with the source command, the prompt package was too big an error. That package Mymanager exported, this time with MySQL with the Mysqldump tool successfully exported and imported into the
mysq Index Type: normal index, unique index and primary index
1. General Index
The only task for a normal index (indexed by the keyword Key or index) is to speed access to the data. Therefore, only those that appear most frequently in the query
First, the MySQL user's basic description:
1.1 Basic structure of the userUsers of MySQL: User name @ host
Username: within 16 charactersHost: Can be host name, IP address, network address, etc.Host Name: Www.111cn.net,localhost
ip:192.168.0.1
MySQL is divided into two roles
1, master server Master
2, from the server slave
MySQL master-slave replication is the database synchronization between two servers, can also be understood as a backup of the primary server, when the master server
Solution 1:
Open Task Manager-service-mysql** to see if its status has started, such as not started, right after the start, re-open the MySQL command line Client, restart MySQL.
Solution 2:
The host file (the host file in the
Mydumper Installation
1, first install CMake, because this software to use CMake compile
The code is as follows
Copy Code
# Apt-get Install CMake
2, the next installation Mydumper compatibility package, this
Note: This document has two MySQL instances, multiple instance methods and so on
Linux operating system: centOS6.3 64bit (Installation of the system default development package)
Example one:
MySQL version: mysql-5.0.56
A unibilling machine suddenly loads heavier a few days ago. The CPU is found to be heavily occupied in top. The AGI program runs slowly, and a zombie process occurs. In fact, there were only about 50 concurrent calls. Far from the normal level. The
Single-table MySQL UPDATE statement:
The code is as follows
Copy Code
UPDATE [low_priority] [IGNORE] Tbl_nameSET col_name1=expr1 [, col_name2=expr2 ...][WHERE Where_definition][Order BY ...][LIMIT Row_count]Update
The code is as follows
Copy Code
SELECT * FROM Test_infointo outfile '/tmp/test.csv 'Fields terminated by ', ' optionally enclosed by ' "' escaped by '" 'Lines terminated by ' RN ';
To import CSV format data in MySQL:
MySQL tutorial cycle and conditional judgment SQL query Writing, we all know that only the MySQL 5 after the stored procedures, these usages, then we want in the SQL with if else while these, we have to use the stored procedure or function to
In MySql4.0.12, with the "CREATE TABLE Bak_name as SELECT * from Original_name" statement
, the generated Bak table does not have a primary key and the index, the use of the time to pay attention to. You can build a table structure that you want to
The Date_add () function adds the specified time interval to the date.
GrammarDate_add (Date,interval expr type) The date argument is a valid datetime expression. The expr parameter is the time interval that you want to add.
The type parameter can
Workaround One:
To other MySQL-installed servers (if you want to know the MySQL root password on the server), open the "MySQL installation directory/var/mysql tutorial," which will be the user.frm, user. MyD, user. Myi three files are copied to the
These statements create a stored subroutine. To create a subroutine in MySQL 5.1, you must have the Create routine permission, and alter routine and execute permissions are automatically granted to its creator. If binary logging is allowed, you may
MySQL tutorial is null usage
Note that in MySQL, 0 or null means false and other values mean true. The default truth value of a Boolean operation is 1.
The special handling of NULL is in the previous section, in order to determine which animal is
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