Connecting to a database
Here is the simplest PHP connection to the MySQL database code:
The code is as follows
Copy Code
$link =mysql_connect ("localhost", "root", "password");if (! $link) echo "Connect error";else
One, indexing base usage
1. Create an index
You can create an index when you execute a CREATE TABLE statement, or you can add an index to a table by using either CREATE INDEX or ALTER TABLE alone.
1>alter TABLE
ALTER table is used to create a
40G Extra Large capacity free PHP space
The free php space size is: 40GB;
Monthly flow limit of: 1000GB;
Single file maximum limit is: 2MB;
Support Ftp/web way to upload and manage filesMoving Address: http://www.40gigs.com/
free 20GB Extra
p4web free php/mysql space, 200m/support FTPMonthly flow limit for: 5,000MB;
Support Ftp/web way to upload and manage documents;
Can bind domain names or use their official two-level domain name;
P4web free space Address: http://www.p4web.biz/
55
Method One, modify directly in command mode
1, Myisamchk
To fix the MySQL database, there is also a command: Mysqlcheck
Mysqlcheck-a-c-o-r–all-databases-uroot-p//This command is the best way to optimize all DB databases.
The meaning of the
Net Letter Technology 100M free Universal Space ApplicationSupport ASP, asp.net, PHP program;
※ Support Access, MSSQL, MySQL database; SQL space needs to be purchased separately;
※ The genuine anti-virus system regularly updates virus code base
1. Delete from T1 where condition
2, delete t1 from T1 where condition
3, delete t1 from T1,t2 where condition
4, delete t1,t2 from t1,t2 where condition
The first 3 are feasible, and the 4th is not.
That is, simply use the DELETE statement to
Mysqldump tools, basic usage is:
Shell> mysqldump [OPTIONS] database [tables]
If you do not give any tables, the entire database will be exported.By executing mysqldump--help, you can get the options table supported by your mysqldump version.Note
Find out what binary log files are currently
The code is as follows
Copy Code
Mysql> show binary logs;+------------------+-----------+| Log_name | File_size |+------------------+-----------+| mysql-bin.000001 | 1357315
The method is as follows:
1. Modify the C:appservmysqlmy.ini file, find the Skip-innodb, add the # in front, and save the file.2. In operation input: services.msc, restart the MySQL service.3. In phpMyAdmin, mysql->show engines; (or perform
If you are using a MySQL version of 5.0 or more, you can get it by querying the tables in the INFORMATION_SCHEMA library, which uses table_rows to record the number of rows in the table. For example, to view the number of records for all tables in
Specific methods
The code is as follows
Copy Code
#!/bin/bash#Shell Command for Backup MySQL Database everyday automatically by Crontab#Author: Carlos Wong#Date: 2010-08-24
#配置参数
code is as
Install homebrew
Homebrew is a very useful Package manager under the Mac, and automatically installs the dependent packages to free you from the cumbersome software dependency installation.Installing homebrew is also very simple, just enter in the
Question: I created a table to hold the customer information, and I know that you can insert the information into the table with the INSERT statement, but how do you guarantee that you don't insert duplicate records?
Answer: You can prevent the
MySQL Tutorial two server database tutorial implement synchronous Data backup method
1. Server StatusServer a:192.168.1.1Server b:192.168.1.2
2. Create a synchronization userHost Domain a:192.168.1.2 username a:sync_a password a:aaaHost Domain b:19
Wamp installed, the MySQL tutorial password is empty, then how to modify it? In fact, it is very simple, through a few instructions on the line, I have to operate the next step.
First, open the MySQL console via Wamp.
Prompt for password,
1, first detect whether the system with the original version of the MySQL installation package, if there is to uninstall first delete, otherwise can not be successfully installed and started;
# rpm-qa|grep MySQL to see what packages are installed,
Rsyslog Introduction:
The Rsyslog service is specifically responsible for recording system log information on CentOS (earlier versions of the system use Syslog,rsyslog as the next generation of syslog), and Rsyslog consists of three parts:
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