Recent project software upgrades to support transactions, make an example for everyone to learn the referenceEnvironment MySQL 5.2/php 5The table type that supports transactions requires InnoDB
The code is as follows
Copy Code
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
To view the MySQL file directory My.ini file, you can find similarDatadir= "D:/beeagle/program files/mysql/mysql Server 5.0/data/" The path is the MySQL Data directoryDefault in: "C:\Documents and Settings\All Users\Application Data\mysql\mysql
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
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
Creating a Database
Command:
The code is as follows
Copy Code
Create DATABASE
Example 1:
Create a database named XHKDB
The code is as follows
Copy Code
1. CREATE database name;2.
Mysqlhotcopy usage
You need to install PERL-DBI and Dbd-mysql before using mysqlhotcopy:
1, the implementation of Yum install PERL-DBI installation perl-dbi.2, installation Dbd-mysql Please refer to the bottom material
A common example of backup:
command line source Import Database:
The code is as follows
Copy Code
1, to move the imported. sql file to the bin file, this is a convenient path2, the 1th step with the above export3, enter mysql:mysql-u user name-PAs
Installation EnvironmentCentOS 5.4MySQL 5.1.xx with rpm direct installationxtrabackup 1.2.22 with rpm direct installation1. master:/etc/my.cnf
The code is as follows
Copy Code
[Mysqld]Server-id = 1Log-binInnodb_flush_log_
Cases
The code is as follows
Copy Code
mysqldump--default-character-set latin1-uroot-pxxx database name >/tmp/old.sql
Similarly, the same is true for exports:
The code is as follows
Copy Code
First we want to enter your MySQL server, use net stop mysql to stop MySQL, and then run the DOS command, enter CMD in the run, and then switch to the MySQL bin directory, run the command:
The code is as follows
Copy Code
Method One, has the server Management permission modification method
View database-level character set support
The code is as follows
Copy Code
Mysql> show VARIABLES like character_set_% ';Mysql> show VARIABLES like
SQL statement:
The code is as follows
Copy Code
UPDATE table_name Set Field_name=replace (field_name, ' from_str ', ' to_str ')
Descriptiontable_name--the name of the tablefield_name--Field Namefrom_str--a
1. Query a table in the different parts of table BField not in (result set)
Select Aurl from Atab WHERE aurl isn't in (select DISTINCT burl from Btab)Note: MySQL supports subqueries starting at 5.0.
If you compare multiple fields, you can use
Databases have evolved from a simple collection of data files to today's large database governance systems, which have become an indispensable part of our daily lives. Without the help of databases, many simple tasks will become tedious and even
Question 1Today I installed mysql and php on this book, everything is installed normally (php@IIS7.5-fastCGI ). However, the error "#2002 unable to connect" occurs when you use phpmyadmin to connect to the test. The same problem occurs with other
$ Errmsg = "";If (! @ Mysql_connect ("localhost", "trainee", "abc123 ")){$ Errmsg = "Cannot connect to database ";} @ Mysql_select_db ("wellho ");// First run ONLY-need to create table by un commenting this// Or with silent @ we can let it fail
Mysql_get_server_infoDefinition and usageThe mysql_get_server_info () function gets information about the MySQL server.This function returns MySQL server version success or FALSE failure.SyntaxMysql_get_server_info (connection)Parameter
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