Large data, the pressure is not in PHP, mainly in MySQL.PHP can do load balancing, 10 machines will not withstand the use of 20 or 100 units, this is not a bottleneck.But MySQL is a single point, no matter how much from the library, are optimized
First we need to know the following SQL statement to query MySQL database/table related information:
The code is as follows
Copy Code
Show DATABASES//list MySQL Server database.Show table [from db_name]//list database
The advantage of MySQL using Binlog is the flexibility of data recovery
Binlog set incorrectly will make the disk full error, this situation occurs first of all, the database Binlog clean up
Previous deletion based on Binlog name
PURGE {MASTER |
The syntax of MySQL
The great thing that you do in MySQL is that "code" is very easy to read for humans, and not more difficult programming languages such as C or C + +. Only a handful of special characters and symbols must be set up for a MySQL
Definitions and usageThe Mysql_affected_rows () function returns some of the affected rows before the MySQL operation.This function returns the success of some of the affected rows, or-1 if the last operation fails.Grammar
Mysql_affected_rows
?
if (! $session &&! $scid) {
$session = MD5 (Uniqid (rand ());
Setcookie ("SCID", "$session", Time () 14400);
}/* Last number are expiration time in seconds, 14400 sec = 4 hrs * *
Class Cart {
function Check_item ($table, $session, $product)
Stored procedures and functions are just introduced by MySql5.0. There is no direct support for this operation in PHP. But because of the design of the MySQL PHP API, we can support stored procedures and function calls in the MySQL PHP API in
The following is the file code for backing up MySQL databases under Linux via Apache PHP:
File one, listtable.php (file lists all tables in the database for backup selection)
Use XML to back up the MySQL database
Please select the table you
1, install MySQL (Django install slightly):
[Root@itchenyi-1 django-1.3.3]# yum install mysql-server mysql-devel[Root@itchenyi-1 django-1.3.3]# Yum Install Mysql-python
2. Set up MySQL database and User:
[root@itchenyi-1 django-1.3.3]# Service
When we do a statistical query, sometimes we need to use the same date/position and other conditions of different information for the row of the statistics, this time will need the following methods to statistics, very convenient.1. Table structure>
The server quit without updating PID file (/usr/local/mysql/var/xxx.pid). ... failed error resolution
Error message Detailed Description:
root@myserver:~# service MySQL StartStarting MySQL.. The server quit without updating PID file
1, through floor error
You can use the following code
and select 1 from (SELECT COUNT (*), concat (version (), Floor (rand (0) *2)) x to Information_schema.tables Group by X);
and (select COUNT (*) from (SELECT 1 Union SELECT NULL UNION SELECT! 1)
What is the InnoDB transaction log
Have you ever used undo or redo functionality in a text editor and imagine the editor's actions in that scenario? I'm sure you should have used it. Do you believe it? transactional databases have the same
Database backup is a very important thing, the way of backup is also a lot of the direct backup through the VPS, and some through the phpMyAdmin data for backup. Small knitting think these should be troublesome and backup good. sql files are too
A. Install MySQL
I use the MySQL is 4.0.20, source code version, you can also use the RPM package or binary sedan, installation method may not be the same, please refer to other articles.First download the source code version of Mysql2.0.20,
About Login :1mysql-uroot-proot (Direct login Password Enter this p is the password)2mysql-u-root-p (Enter password after entering the root correct login success) 3mysqle--username=root--password (5.5 can) 4mysql-hlocalhost-uroot-pabout exiting
1 Difference One:VARCHAR: A variable-length string. Determines the number of characters to use based on the length of data addedChar: fixed-length string2 Difference Twoint: No LimitInt (4): Limit to 43 Difference Three:Date: Date datetime
Some time ago, I designed the architecture for the SNS product, conducted a lot of stress tests on the program framework, and finally selected YiiFramework. Why didn't I choose the company's internal PHP framework, in fact, the reason is very good.
1. Do not rely on magic_quotes on the server, although they are all open by default (magic_quotes_gpc)Disable the following twoIni_set ("magic_quotes_runtime", 0 );Ini_set ("magic_quotes_sybase", 0 );Add magic_quotes manually to all variables, that
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