Database backup Classes
How to use:
The code is as follows
Copy Code
Require_once ("backdata.class.php");$link = @mysql_connect ("localhost", "Database name", "password") or Die (' could not connect to server.
Grammar
Mysql_connect (Servername,username,password);
Example
In the following example, we store a connection in a variable ($con) in a script for later use. If the connection fails, the "Die" section is executed:
The code is as
。 The method that invokes the stored procedure.
A. If the stored procedure has in/inout parameters, declare a variable, input parameters to the stored procedure, the variable is a pair of PHP variables (also can not, just do not have PHP variables,
The following is a description of the main content of the article.
The code is as follows
Copy Code
Found_rows (): SelectRow_count (): UPDATE Delete Insert
Note: You need to work with the appropriate operation,
JSP tutorial connecting to the MySQL Tutorial database tutorial code
//Method One compiles the Dbconn.java using the JDK's Javac command to form the corresponding class file. = "cd /tomcat4112/webapps
The same website program runs under Linux more quickly than in Windows, so decided to use Linux distribution CentOS, this article mainly explained under CentOS use Yum command to install the lamp detailed process. The software we use is the latest
1. Install apache,mysql,php with Yum1.1 Installing Apache
The code is as follows
Copy Code
#yum Install httpd Httpd-devel
When Setup is complete, start Apache with/etc/init.d/httpd startSet to boot:
jquery+php query MySQL to implement AutoComplete, write this tutorial, because most of the things you've seen about AutoComplete are just giving you a source code package, and then telling you how to use it, rather than telling you how it works and
The code is as follows
Copy Code
Update ' table_name ' SET ' field_name ' = replace (' Field_name ', ' from_str ', ' to_str ') Where ' field_name ' like '%from_str% '
Description
table_name--the name of the tablefield_name-
First look at the syntax of the Find_in_set function in the MySQL manual:
The code is as follows
Copy Code
Find_in_set (Str,strlist)
If string str is in the strlist of a string list of n chains, the return
We often use unique numbers in database applications. The Auto_increment property of the field can be generated automatically in MySQL. MySQL supports a variety of data tables, each of which has a different self added attribute.
ISAM Table
If you
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;
Recently, because of the need to study the MySQL random extraction implementation method. For example, to randomly extract a record from the TableName table, the general wording would be: SELECT * from TableName ORDER by RAND () LIMIT 1.
There are
The My.ini in the MySQL directory, and then copies a my.ini on the colleague's machine to modify it and put it in a separate place as a backup. The contents are as follows:
The code is as follows
Copy Code
Because to debug the relationship of the program, from the background to modify the MySQL settings, set tojoin_buffer_size=512kAfter the result is saved MySQL cannot connect immediately, reboot Lu-restart,mysql-restart cannot connect.
Operation
PHP Write paging function, as long as the use of MySQL, is basically two steps away
1. Total number of pages. SQL statements are naturally
The code is as follows
Copy Code
SELECT Count (*) from TableName;
2,
1. Update the installation environmentBefore installing this Web application, we need to update the latest system software package and run the following command line. The code is as follows:Copy code Sudo apt-get updateSudo apt-get upgrade 2.
The master-slave configuration is relatively simple. Record it briefly.Set the ip addresses of the two servers to 192.168.16.211 and 212 respectively.For the convenience of the experiment, the root password of Mysql is empty.Add server load balancer
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