PDO Data Preservation
The code is as follows
Copy Code
$pdo = new PDO ("Mysql:host=localhost;dbname=db_demo", "Root", "");if ($pdo-> exec ("INSERT into Db_demo (name,content) VALUES (' title ', ' content ')") {echo
The code is as follows
Copy Code
$fname = $_files[' myfile ' [' name '];$do = Copy ($_files[' myfile '] [' tmp_name '], $fname);if ($do) {echo "Successfully imported data ";}else{echo "";}
The code is as
/*** * Description, this class is suitable for small Web site database tutorial backup, built-in MySQL connection, simply configure the data connection * and storage backup location. The Show_dir_file () method in the * class can return
Concepts & FunctionsBinary logging means that when you do a data flow operation, the database records the SQL operations in addition to the Select, such as UPDATE, DELETE, alter ..., and the type of record contains the full SQL statement, operation
The MySQL order BY keyword is used to classify the data in the record.
MySQL ORDER BY keyword classified by keyword
The ORDER BY keyword is used to classify the data in a record.
The code is as follows
Copy Code
SELECT
Specify the location of the log in the configuration file.
The windows:windows configuration file is My.ini, usually under the MySQL installation directory or c:windows.The Linux:linux configuration file is my.cnf, usually under/etc.
You can also
Table article, the time to store the article added is the Add_time field, which is type int (5) and now needs to query the total number of articles added today and sorted by time from big to small, the query statement is as follows:
1 SELECT * from
Add, modify, delete functions in the MySQL tutorial
ALTER TABLE tabelname add new_field_id int (5) unsigned default 0 NOT NULL auto_increment, add primary key (NEW_FIELD_ID);
Add a new column
ALTER TABLE T2 add d timestamp;ALTER TABLE infos add
1. Set up a new storage path
Mkdir-p/data/mysql
2. Copy existing data
Cp-r/var/lib/mysql/*/data/mysql
3. Modify Permissions
Chown-r Mysql:mysql/data/mysql
4. Modify the configuration file
Vim/etc/mysql/my.cnfDataDir =/data/mysql
5. Modify
MySQL Tutorial Repair Database Tutorial InstancesAlter DATABASE [Dvbbs] SET Single_userGoDBCC CHECKDB (' Dvbbs ', repair_allow_data_loss) with TABLOCKGoAlter DATABASE [Dvbbs] SET Multi_userGo
Using the PHP tutorial MyAdmin the repair process
Use WinRAR to perform a scheduled backup of the MySQL Tutorial database tutorial.For MySQL backup, the best way is to directly back up the MySQL database data directory. A method of using WinRAR to perform a scheduled backup of the data directory is
MySQL Tutorial stored procedure syntax
Variable definition:
Declare variable_name [, variable_name ...] datatype [default value];
Where datatype is the data type for MySQL, such as: int, float, date, varchar (length)
Cases:
DECLARE l_int int
ASP tutorial. NET C # java calling MySQL tutorial stored procedure methodsThis article mainly introduces three kinds of asp.net tutorial C # java Call MySQL stored procedure method, each example illustrates how to create such as invoking the MySQL
MySQL Tutorial slow Query analysis method one:
This method I am using, hehe, more like this kind of instantaneous sex.
More than mysql5.0 versions can support logging of slower-performing SQL statements.
Mysql> Show variables like ' long% ';Note:
I need to remove the latest content from each category now.
Copy code code as follows:SELECT * FROM test group by category_id order by ' date '
The results are as follows
Obvious. This is not the data I want because the order in which MSYQL has
After using the mysqldump command to export the MySQL database, the following commands are often used when importing the database. The code is as follows:Copy code Mysql -- default-character-set = utf8-u root-p dbname However, when the exported
The execution efficiency of mysql statements affects the operation of the entire website. It is vital to check the efficiency of mysql statements at any time. Using the EXPLAIN keyword can let you know how MySQL processes your SQL statements, it
Sometimes, we need to copy the data in the entire column of a field to another new field, which is very simple. The SQL statement can be written as follows:UPDATE tb_1 SET content_target = content_source;The syntax is as follows:Update {your_table}
When MySQL uses the row format and the default binlog_row_image = full, the binlog records the complete data image before and after the update. Therefore, it is feasible to perform the undo operation based on the binlog in the row format. I tried
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