Mysqldump is a database backup and restoration tool that comes with mysql. I don't think many of you have used it, or you have been using phpmyadmin to operate it, or you can directly package the database on the server, next let's take a look at the
You will not only encounter this situation in Hibernate, but also in mainstream php. If your database encoding is different from the page encoding, chinese garbled characters may occur.
Today, we encountered garbled characters when using Hibernate
We can use the mysql command mode to import or export csv files. If you need it, you can simply refer to it.
Mysql> select * from tt_address;+ ----- + -------- + ------ + -------- + ------------ + ------------- + ----------- + ---------- + ------- +
Calculation yearsIf you want to calculate the person's age by birthday, you can use the following statement:
SELECT DATE_FORMAT (FROM_DAYS (TO_DAYS (now ()-TO_DAYS (@ dateofbirth), '% y') + 0;
2. Difference between two time pointsReturns
1. Use the rowid Method
2. Use the group by Method
3. Use the distinct method
1. Rowid Method
The statement is as follows:Query data:
Select * from table1 a where rowid! = (Select max (rowid)
From table1 B where a. name1 = B. name1 and a. name2
Modify the mysql tutorial engine
Modify my. ini and add
Default-storage-engine = INNODB
The red font indicates the engine name to be specified.
Use SQL statements to modify the engine of a table:
Alter table tableName type = InnoDB
My. ini file for
Detailed description of MySQL database Restoration
Binlog backs up data by recording binary files, and then restores data from the binary file to a certain time period or operation point.
1: Enable binlog Logging
Modify the mysql tutorial
How to create and delete a database in the mysql tutorial
Create Table syntaxCreate database ;Look at a simple instance.
Mysql>Mysql>Mysql> create database myDatabase;Query OK, 1 row affected (0.03 sec)
Mysql>Mysql> drop database myDatabase;Query
Can't create a new thread (errno 12)Error No:1135Problem Analysis:Database tutorial server problems, database operations cannot create new threads. Generally, there are two reasons: 1. Too many threads are opened in the mysql tutorial. 2. The server
Ascii (str)Returns the ascii code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is null, return null.
Mysql tutorial> select ascii ('2 ');
-> 50
Mysql> select ascii (2 );
-> 50
Mysql>
Here we use the SQL replace function to operate the dedecms database. Now I want to change the image address litpic OF THE dedecms database and the address in introduce to an operation note for a second-level domain name address, if you need it, you
In the mysql tutorial, there is a string connection function concat (). Let's talk about how to use it.
Concat syntax
Concat (str1, str2 ,...)
Look at the code in the dedecms search program.
$ K = addslashes ($ k );
If ($ this->
Mysql tutorial master-slave data synchronization and backup experience
Preparations:1. Two machines (My winxp ip 192.168.0.119 master server win2003 192.168.0.17)2. Install the mysql database tutorial server on the two machines respectively (Note:
How to import a stored procedure from mysql this article provides two methods for importing a stored procedure from mysql to mysql and how to export a stored procedure from mysql. Let's take a look at the example of the exported stored procedure,
Mysql tutorial SQL distinct Delete duplicate records
How to Use the distinct keyword in mysql to filter duplicate values in the result list of a select statement
If you want to delete duplicate data when querying data, you can use the distinct
How to retrieve the root password in the mysql tutorial
In the php tutorial myadmin, you can enter mysql. Use the username and password used to access phpmyadmin,
If phpmyadmin can be accessed, check it in config. php or config. default.
How to export an excel file in the mysql tutorial
Method 1
Php tutorial using mysql commands and shell
Select * into outfile './bestlovesky.xls' from bestlovesky where 1 order by id desc limit 0, 50;
Method 2: Open bestlovesky.xls in text format,
This tutorial describes how to query and delete the mysql view. You can use the show view name to query the view and delete the mysql view with the drop permission. However, you must have the drop permission to delete the view. Next let's take a
Optimization of table-level locking of MyISAM storage engine
MySQL supports table-level locking for MyISAM and MEMORY tables, page-level locking for BDB tables, and row-level locking for InnoDB tables.Table-level locks: low overhead, fast locking,
How to solve MySQL Chinese sorting errors/*
Method 1
Change the character set of the field to gbk, and then use order by to sort the field directly.
Mysql tutorial 5.x supports defining character sets for a column
Method 2
Add the "binary" attribute
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