It's already midnight, and May Day is boring.
You can't sleep. You can install a virtual machine on your computer. Then, you can build a php environment on the virtual machine.
First, install MYSQL. I found many problems .. I will try again
At that time, we were preparing to build a project, so I built the lamp server and directly installed all the files in yum, because centos is a relatively stable system, therefore, none of the above software is up-to-date. apache is 2.2.15, php is 5.
When exporting data in a database, how do we export data from a table without exporting all the data in the table? The following example shows how to perform this operation.
Assume that a data table (news) has three fields: id, title, and content.
Occasionally, you need to use php to perform some mysql Database Operation tests. It is too troublesome to write by yourself. The search results generally contain a lot of useless code. Here we will summarize the operations of php mysql, I hope you
Sina sae official documentation: http://apidoc.sinaapp.com/sae/SaeMysql.html
Class SaeMysql implementation: http://apidoc.sinaapp.com/__filesource/fsource_sae__saemysql.class.php.html
The official Sina documentation provides a simple
Impact of storage engine on char and varchar selection:
For the MyISAM storage engine: it is best to use a fixed-length data column instead of a variable-length data column. In this way, the entire table can be static, so that the data retrieval is
SQL server
Replace null: isnull (arg, value)
For example, select isnull (price, 0.0) from orders. If the price is null, replace it with 0.0.
Comparison with null: is not null, is null
For example, select * from orders where price is null and price
SQL alert adds, modifies, and deletes field syntax instances
The alter table syntax is as follows:
Alter table "table_name"
[Change method]
The detailed Writing Method of [change method] varies depending on what we want to achieve. In the changes
1. The access database system has the SQL injection vulnerability. mssql database also supports this technology.
2. You need to know the name of the table where the data to be burst is located and a field name under the table, which is generally an
Http://down.chinaz.com/server/201207/2090_1.htm
How to start the InnoDB EngineMysql uses the MyISAM Data Engine by default. Unfortunately, this engine does not support transaction processing. We need to change the default data engine to InnoDB.
Index fields in database tables can greatly improve the query speed. Suppose we have created a mytable table:
Copy codeThe Code is as follows: create table mytable (id int not null, username VARCHAR (16) not null );
We randomly inserted 10000
In the following example, 'table _ name' indicates the data table name, 'index _ name' indicates the index name, and column list indicates the Field list (for example, 'id ', 'order _ id ').
1. Create an index
You can CREATE an INDEX in the create
Today, let's take a look at common commands in MySQL (command keywords in MySQL are case insensitive ):
(1) show databases; displays all databases in MySQL
(2) create database dbname; create database dbname in MySQL
For example, we create a database
1. rename database db_name TO new_db_nameThis .. This syntax is added to mysql 5.1.7 and removed from mysql 5.1.23.Data may be lost. Or don't use it.See: http://dev.mysql.com/doc/refman/5.1/en/rename-database.html
2. If all tables are of the MyISAM
There are two main reasons for mysql downtime:
1. The memory is heavily occupied by other processes, or the database data volume is too large, leading to mysql downtime2. After the program accesses mysql, it does not execute mysql. close, which
MySQL display status information
1. show status
mysql> show status;+-----------------------------------+----------+| Variable_name | Value |+-----------------------------------+----------+| Aborted_clients | 0
In the MyISAM engine, index data frequently read from disks is loaded into memory to improve io efficiency and read efficiency.
MyISAM designs an index buffer pool Key Cache in the memory. Key Cache only caches index data and uses the LRU algorithm
1. Shut down the mysql database you are currently running. You can either end the mysql process or directly close the mysql server.
2. Close the database and click Run to start running. Enter cmd to enter the command line window. In this
Mysql has some time functions, although not commonly used, but sometimes used for interviews.
1. Convert the current time to the timestamp
select UNIX_TIMESTAMP();2. We generally do not directly describe the specific age about age. Because age is
Access Version: 2007-2010,64-bit
Mysql version: Ver 14.14 Distrib 5.6.12, for Win64 (x86_64)
1. Download the windows 64-bit Mysql driver
Official http://p2s.newhua.com/down/mysql-essential-5.1.40-win32.msi
Csdn resource
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.