First, put the MySql.Data.dll in the bin directory.
Second, this is the aspx.cs of all the source code, modify the parameters to run directly!
UsingMySql.Data.MySqlClient;
1. Start from database structure 1. The definition of a field type follows the following rules: 1. Select the minimum length of the field 2. Use fixed length 3 as much as possible to define "not NULL" 4. Avoid using "Zerofill" in numeric fields
The difference and usage of MySQL and mysqli
MySQL is a non-holding relay function and MYSQLI is a permanent connection function. Other words
MySQL each link will open a connected process and mysqli run mysqli multiple times will use the same
The last time we introduced the MySQL 5.1 master configuration tutorial, this time we come to achieve the MySQL 5.5 Master-slave replication, in fact, the overall configuration is almost the same, only a few subtle differences. System: CentOS
Insert record of Mysql statement Instert
Single line insert
The code is as follows
Copy Code
Insert into table name (field name, field name, ...) VALUES (field value, field value,...);Insert into A (a_e,a_f,a_a) values (
Delete null data
The code is as follows
Copy Code
Delete from table name where field name = ' or delete from table name where field name =null
Remove Space data
Also contains spaces in the middle of the string,
MySQL Delete field duplicate data, after the search has just begun to do:
Delete from V_togowhere Tel in (select Tel. V_togo GROUP BY Tel has count (tel) > 1)and Togoid not in (select min (togoid) from V_togo GROUP BY Tel has count (tel) >1)
Let's look at the timing backup method in Windows
Method a mysqldump Backup database
Create a new file, such as Mysqldump.bat.Write the following code to the file Mysqldump.bat
The code is as follows
Copy Code
@echo
How do I return an ID number that inserts a data from the ID of the data?
PHP function mysql_insert_id () is the value of the field defined by Auto_increment after the last time an insert query was executed.
Sample code
The code is as
The MySQL database table's self-added primary key ID number is messed up and needs to be rearranged.
Principle: Remove the original ID and re-establish the new self ID.
1, delete the original primary key:
The code is as follows
#vi/etc/my.cnf
Open MY.CNF Modify Encoding
Vi/etc/my.cnf
Add under [mysqld]
The code is as follows
Copy Code
Default-character-set=utf8or DEFAULT-CHARACTER-SET=GBK.Add under [client]Default-character-set=utf8or
This article describes how to check the MySQL database, view the current date, using the MySQL current_date variable.
We can execute SQL statements when we log on to MySQL using the MySQL client tool or other graphical tools. If we want to look at
If you forget the root password can be modified by the following method
Note--skip-grant-tables can turn off permission validation
1. Modify the MySQL configuration file under [mysqld] Add a line of configuration--skip-grant-tables, restart MySQL
The company's database storage engine was all MyISAM, data volume and access is not very large, so there is no problem. However, the recent occurrence of the MySQL data table is often locked, directly caused the user to connect the site timeout and
Like my side. query Jz_user table user creation time is greater than April 1 to April 30 for example
The code is as follows
Copy Code
Select From_unixtime (create_time), user_id from Jz_user Where date_format
Linux cannot restart solution after MySQL reload
Before the installation of the mysql5.1, but after the System Restore service did not, simply upgraded to 5.5, but the installation is good, the last step of configuration is not start!
View log:
When it comes to MySQL's execution, it has to say its execution process. And its execution process is divided into standard execution process and optimized execution process.
Standard processStandard processes are standard processes for SQL
Method One:
My common practice is to add a Delete identity field to the database.such as: isdel=1 so that the code deleted the field
Method Two:
Direct restriction of MySQL DELETE statement deletion
Add parameter-u when starting MySQL
Recently, I want to develop an information management system for the company from the development machine (Windows NT IIS4.0 Access) migrating to a real Linux server (Apache1.3.12 PHP 4.03 MySQL 3.23.26), the migration of content from dozens of
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