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
In a project, when we build a data form, two representations are associated, and the data in one table is completely dependent on the data of another table,
FOREIGN KEY constraint syntax
[CONSTRAINT [Symbol]] FOREIGN KEY[Index_name]
National day back, found that MySQL stopped service, no way to continue to start. To view the log, see:
131008 09:56:03 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql131008 9:56:03 [Warning] option ' read_buffer_size ':
All know that by executing select sleep (n) in MySQL, you can have this statement run for N seconds: Mysql> Select Sleep (1);+----------+| Sleep (1) |+----------+| 0 |+----------+1 row in Set (1.00 sec) The execution time returned to the client
To help colleagues deal with a tricky business today, the problem is this:
Regardless of which version of the MySQL client the client connects to the server, it is found that as long as the server side is set
After character-set-server = UTF8,
One of the recovery methods
1, first of all to confirm the security of the server state, that is, no one can arbitrarily connect the MySQL database. Because the MySQL database is completely out of password protection during the reset of the MySQL
COUNT (*) it returns the number of rows retrieved, regardless of whether they contain null values.SELECT retrieves from one table without retrieving other columns, and when there is no WHERE clause, COUNT (*) is optimized to the fastest return speed.
50m-200m Free space Support asp/phpSupport for html/shtml/asp/php scripts, support for Access/mysql databases
Do not limit network traffic, do not limit CPU resource allocation, IIS connection amount/apache Connection amount: 50 100 200
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
MySQL Character set: cp1252 West European (latin1), solve garbled problem
Use the virtual host space on the phpMyAdmin operation database, if you see the phpMyAdmin home page on the MySQL character set for cp1252 West European (latin1), when we
SQL Lock table Reconciliation lock MySQL Tutorial statement
For MySQL, there are three types of lock levels: page level, table level, row level
The typical page-level representative engine is BDB.The typical representative engine for the table
MySQL tutorial supports the implementation of Chinese Full-text search
Without affecting the system structure of MySQL and other functions, this paper solves the shortcoming that MySQL can not correctly support Chinese Full-text search and
1, to optimize the table
2, Analysis of the table (analysis and storage of MyISAM and BDB table in the distribution of keys)
3, check the table (check the table error, and update the key for the MyISAM statistics)
4, repair the table (repair the
LAMP is the abbreviation of Linux Apache MySQL PHP, in fact, the Apache, MySQL and PHP installed on the Linux system, to form an environment to run PHP scripting language. As for what is the PHP scripting language, I no longer introduce, please
Error message ECSHOP info: Can't select MySQL database (ram). How Can I solve this problem?The ecshop displays the "Can't select MySQL database" error prompt. How many lines of big prompts are displayed on the entire web page, and then there is a
1. Permanent free filing is requiredWEB space: 500 M + MySQL database: 50 MNumber of IIS connections: 100 | support for PHP/MySQL and common componentsSupports custom pages such as 404 | supports pseudo-static rewriteIndependent control panel |
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