Mysql PHP Version blasting small script
(Note: From the code you can see that the user name is a variable, the general database account does not change, so the user name does not use the array as a dictionary.) A password is a dictionary using an
MySQL is a more commonly used database, daily development is also used more. 工欲善其事 its prerequisite, this article specifically explains how to install MySQL under CentOS (similar to other Linux distributions). First prepared materials: Mysql, I use
Two programs on the network to achieve the exchange of data through a two-way communication connection, the end of this connection is called a socket, generally in the configuration of the MySQL environment in the MySQL my.cnf file in the [mysqld]
In MySQL, indexes can be divided into two types of hash index and Btree index.
Under what circumstances can I use a B-tree index?
1. Full Value Matching index
Like what:
Orderid= "123"
2. Matching the leftmost prefix index query
For example,
This example describes the MySQL federated index. Share to everyone for your reference, specific as follows:
Employee Table UserIDDepartment Table DeptIDEmployee Department Table
Condition: An employee can correspond to multiple departments
Under the following conditions, MySQL will do a full table scan:
The 1> datasheet is too small to do a full table scan faster than doing a lookup on the index key. This is usually done when the total number of records in the table is less than 10
MySQL Chinese Sort Method 1
MySQL in the query string is not sensitive to the case, when compiling the MySQL in general with the ISO-8859 character set as the default character set, so in the comparison process of Chinese character encoding
1. Export the entire database
Mysqldump-u user name-p database name > exported file name
Mysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql
2. Export a table
Mysqldump-u user name-P database name Table name > exported file name
Mysqldump-u wcnc-p
First create a table
Use Test;
Create Table Tabletest (
' ID ' Mediumint (8) Default ' 0 ',
' Name ' varchar default '
) Type=myisam;
Import data to a datasheet
Load Data InFile ' c:/data.txt ' into Table ' tabletest '
Commonly used as
First, add the user rights that can be logged on the primary server:
GRANT REPLICATE SLAVE on *.* to ' username ' @ ' host ' identified by ' password '
Then set the primary server's My.ini file.
Server-id=1 #主服务器标识
Log-bin
1. Enter the Mysqladmin processlist into the Mysql/bin catalogue;2. Start MySQL, enter show processlist (Close a thread kill ID;);If you have SUPER permissions, you can see all of the threads, otherwise you can only see the thread that you
Take Mysql-noinstall-5.0.22-win32 as an example, after decompression will see the Mysql-5.0.22-win32 folder below, there are five INI format files, the My-medium.ini file copies a copy, renamed My.ini, open My.ini file, in Under [client], [mysqld]
Release in 1.apache2.2\conf\httpd.conf:
Include conf/extra/httpd-vhosts.conf (remove front #)
Increase in 2.httpd.conf
#项目文件夹DWM目录, be careful not to use Chinese to define directories and folders
#
# Possible values for the Options directive are '
or part of the cronjob, which is running in the background interactively in the rails timing task
Checkipaddress () {echo $ |grep "^[0-9]\{1,3\}\.[ 0-9]\{1,3\}\. [0-9]\{1,3\}\. [0-9]\{1,3\}$ ' >/dev/null if [$ = 1]; Then return 1 Else a= '
Daily backup MySQL database tasks, delete the specified number of days before the data, keep the date of the specified day;
Demand:1, backup MySQL data 4 points per day;2, to save space, delete more than 3 months of all backup data;3, delete more
Some questions to note about operating the MySQL database in PHP 1. The exception to the semicolon
For MySQL, the first thing you have to keep in mind is that each line of its command is separated by a semicolon (;) As the end, but ... There is no
Setting up the database
The text or integer type of fields that we usually use in the database and the fields that need to save the picture are different in the amount of data they need to keep. The MySQL database uses specialized fields to hold
Copy Code code as follows:
mysql_connect ("localhost", "root", "1981427")//connection to the server at localhost, username root
?>
Copy Code code as follows:
@mysql_connect ("localhost", "root", "1981427")
Or Die ("Database
Plan to switch a website host, did not expect to encounter PHP and MySQL Chinese garbled problem.
The former foreign host used MySQL is the 4.x series, feel better, regardless of GBK and UTF-8 are not garbled, did not think of the new host MySQL is
How do you install two or more MySQL on a single server? Below is the detailed procedure, together to learn to learn.
First, the environment
MySQL Package:
Mysql-5.6.31.tar
Mysql-5.5.32.tar
Operating system Environment:
CentOS Release 6.8
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