Data table collect (ID, title, info, VType) on these 4 fields, which title with fixed length, info with text, ID is gradual, VType is Tinyint,vtype is index. This is a simple model of the basic news system. Now fill in the data and fill in 100,000
Length: is a calculation of the lengths of a field a Chinese character is counted three characters, a number or letter is counted as a character
Char_length: Whether Chinese characters or numbers or letters is a character
Example:
1, you want to
Use \ \ or see how you define the string. In fact, there are only two escapes: PHP and MySQL.
In PHP, if you define a string with double quotes, there is an escape here. If you use single quotes, you do not escape.$sql = "SELECT * FROM table WHERE
Create a table that holds the ID information for the record you want to delete:
The code is as follows
Copy Code
CREATE TABLE ' Tmp_ids ' (' ID ' int (11),' Name ' char (20)) Engine=myisam;
If you want to
If you are not forgetting the password to modify the MySQL password method There are many, as the following
UPDATE User statement (Huitian record)
This must be done by logging into MySQL with the root account and then executing:
1. If you do not
Look at its grammar first.
The left JOIN keyword returns all rows from the left-hand table (TABLE_NAME1), even if the right table(table_name2) does not have a matching row.
Left JOIN keyword syntax
The code is as follows
Copy Code
Commonly used statements
1, look for redundant records in the table, duplicate records are based on a single field (MAIL_ID) to judge
The code is as follows
Copy Code
SELECT * FROM Table WHERE mail_id to (select mail_id
Method One,
Using phpMyAdmin, this is the easiest, to modify the MySQL library's user table, but don't forget to use the password function.
Method Two,
Format: Mysqladmin-u username-P Old password password new password
1, to root add a password
Apache
The code is as follows
Copy Code
Sudo/etc/init.d/apache2 start starts ApacheSudo/etc/init.d/apache2 Restart Restart ApacheSudo/etc/init.d/apache2 Stop Apache stopped
Mysql
The code is as
The simplest method of port judgment ==> only for database local useMethod for judging the 1:if condition of law
The code is as follows
Copy Code
[Root@oldboy scripts]# Cat check_db01.sh#!/bin/sh#created by Oldboy#mail:
The first step is to see the maximum number of connections under current MySQL
The code is as follows
Copy Code
[Root@localhost ~]#/usr/local/mysql/bin/mysqladmin-uroot-ppassword variables |grep max_connections
The Linux environment in this article is Red Hat 9.0,mysql is 4.0.16.Second, the installation of MySQL1, download the MySQL installation filesThe following two files are required to install MySQL:mysql-server-4.0.16-0.i386.rpmmysql-client-4.0.16-0.i3
Backup and Recovery
For example, we want to back up the MySQL already exists in the database named Linux, to use the command mysqldump
The command format is as follows:
[Root@linuxsir01 root]# mysqldump-u root-p linux >/root/linux.sqlEnter
Error message#1045-Access denied for user 'root' @ 'localhost' (using password: YES)Find the config. inc. Php file in the phpmyadmin directory and modify the following location:For the config. inc. Php file, the most important thing is to modify the
Article field:Id: autoPid: the value of id is not of the auto type.Title: StringProcessing:Insert a record: Connnection conn = ...;String SQL = "insert into article values (null ,? ,?) ";// The following statements generate a PreparedStatement with
1. Set phpMyAdminLanguage: Chinese simplified (zh-utf-8)MySQL character set: UTF-8 Unicode (utf8)MySQL connection verification gbk_chinese_ci2. When creating a databaseSet it to gbk_chinese_ci.3. Create a table using SQLENGINE = MyISAM default
Class mySqlClass {// define the entire database metadata class mySqlClassVar $ querynum = 0; // variable of the number of queries // Open the connection to the server -----------------------------------------------------------------------------------
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