//
Sourceforge:breaking down the barriers to Open Source Development
Copyright 1999-2000 (c) the SourceForge Crew
Http://sourceforge.net
//
$Id: database.php,v 1.6 2000/04/11 14:17:13 CVS Exp $
//
/etc/local.inc includes the machine specific
Method One:
The code is as follows
Copy Code
SELECT * FROM TableName ORDER by rand () limit 1
Change the value of the limit back to the number of bars you want to randomly extract, and take only one.
Method
Yesterday, when using phpMyAdmin to connect to MySQL, there was a #2002– server that was not responding (or the socket for the local MySQL server was not configured correctly), but I did not have any problems with the PHP connection.
The code is as follows
Copy Code
Class MySQL {Private $db _host; Database HostPrivate $db _user; Database user NamePrivate $db _pwd; Database User name passwordPrivate $db _database; Database namePrivate $conn; database connection
Read about the MySQL error injection of technical articles, are similar to the following statements are injected. Such a statement is called the formula "formula", a lot of small dishes are used directly, do not know why this is. But I have to have
Use Overlay Index
A table is built on the id,create_time to establish an index.
The following 2 SQL statements are executed at the same time. Because the query field ID is overwritten by the index.
Select ID from order_manage where create_time > '
Configure apache 1, create a new directory under D (for disks loaded with Apahe and PHP5) d:\web\www (of course, you can build a directory) to store PHP files (try to keep Apache and PHP5 under the same level of directory) . 2, locate the Conf
In fact, Apache and MySQL are installed as a function of the system services, as follows:
The code is as follows
Copy Code
D:wwwrootapachebin>httpd-k Install
Register successfully If you are prompted with the
200M Free space Support asp/phpAddress: Www.ShengHua.BizDomain Name Online binding √Set Default Document √Set Space Status √FTP Online Web upload √FTP client software upload √
300M High speed PHP free space
Hostse free space to use layered panel
Description
table_name--the name of the tablefield_name--Field Namefrom_str--a string to replaceto_str--replaced with string
Example 1
The code is as follows
Copy Code
UPDATE ' table_name ' SET ' field_name ' = replace
Restore a database: mysql-h localhost-u root-p123456 Www
Back up a database: mysqldump-h localhost-u root-p123456 www > d:/www2008-2-26.sql
Backup data:
The code is as follows
Copy Code
Mysqldump-u User name-p password
Let's begin by telling you how to use mysqldump backup
SQL to back up the MyISAM table:
The code is as follows
Copy Code
/usr/local/mysql/bin/mysqldump-uyejr-pyejr--default-character-set=utf8--opt--extended-insert=false-
Backup data:
The code is as follows
Copy Code
Mysqldump-u User name-p password database name > Xx.sql
When the volume of data is large, you can use gzip compression
The code is as follows
Copy
Using cursors (cursor)
1. Declaring a cursor
DECLARE cursor_name Cursor for select_statementThis statement declares a cursor. You can also define multiple cursors in a subroutine, but each of the cursors in a block must have a unique name.
If you forget the MySQL root password, you can reset it in the following ways:
1. Kill off the MySQL process in the system;
2. Use the following command to start MySQL, to do not check the permissions of the way to start;
Error occurred while processing: mysql-server-5.5 mysql-servere:sub-process/usr/bin/dpkg returned an error code (1)
This problem just before I met, a period of time has been bothering me, but after my research, slowly groping, also consulted the
I. Reasons for using the view: 1: security. This is generally done: create a view, define the data operated on the view, and then bind the user permission to the view. 2: query performance is improved. 3: After flexible functions are required, you
How MySQL optimizes LIMITIn some cases, when you use LIMITRow_countWithout HAVING,MySQLQueries are processed in different ways.· If you use LIMIT to select only some rowsMySQL selectionWhen you perform a full table scan, it will use indexes in some
Use your own domain name or sub-same cool.freehostingnow.com10 GB disk space10 GB bandwidthPHP with mysql databaseThree databasesControl panelFTP accessAdvertisement on the website!Application address: http://www.freehostingnow.comDisk Storage 100
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