Installation Environment: CentOS 5.4MySQL version: MySQL 5.1.xx with rpm direct installationRequired Software: Xtrabackup 1.2.22 with RPM direct installation1. master:/etc/my.cnf
Copy Code code as follows:
[Mysqld]
Server-id = 1
Method 1: Using the Set password command
Copy Code code as follows:
Mysql-u Root
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');
Method 2: With Mysqladmin
Copy Code code as follows:
Let's share the following, the way to close the MySQL log
LNMP a key package installed MySQL default open MySQL log, if the site on the database read and write more frequently may generate a large number of logs, and occupy disk space, but also may
Create users and assign permissions;
Copy Code code as follows:
Insert into Mysql.user (Host,user,password) VALUES ("localhost", "Phplamp", Password ("1234"))//create User
Grant all privileges in dbname.* to ' username ' @ '% ' identified
Today found that MySQL can use a slash to be the name of the field, this is an unexpected discovery.
Copy Code code as follows:
CREATE TABLE ' Op_day ' (
' id ' int (one) not NULL auto_increment,
' Date ' is not NULL DEFAULT ' 0000-00-00
Just at the beginning, according to my idea, this is very simple, on the SQL statement
Delete from ZQZRDP where is tel in (select min (dpxx_id) from ZQZRDP GROUP BY Tel has count (tel) >1);
Execute, Error!! ~! ~
The exception means:
Programme I:
1. Enter the:mysql> state
2. Choose MySQL database:mysql> use MySQL;
3. Change user table Data:mysql> Update user set Password=password (' New password ') where user= ' root ';
4. Activation permission:mysql> FLUSH privileges;
5. Exit
All of the following runs through the MySQL 5.5 command line:
To view MySQL-supported character sets:
Copy Code code as follows:
Show CharSet;
View Character Set:
Copy Code code as follows:
Status
The following
The original Linux under the MySQL default is the table name is case-sensitive, through the following settings, you can make MySQL does not distinguish table name case:1, with root login, modify/etc/my.cnf;2, under the [Mysqld] node, add a line:
Customer service There is a need for me to some hotels in Chinese pinyin sorting, has not previously contacted, in the PHP group asked some Daniel. You get 2 answers, all of them. haha ~The following is a MSYQL example, the table structure is utf-8
A problem has been encountered in the work: To update a data table.
This table was created by myself, with 7 fields, IDs, name, package, etc.
When I created it, because I had the name, package information in two text files,
So I used the Insert
String substitution processing using case
Copy Code code as follows:
Mysql> select * from sales;
9 rows in Set (0.01 sec)
SELECT name as name,Case CategoryWhen "Holiday" THEN "seasonal"When "profession" THEN "bi_annual"When '
To import *.sql scripts directly in MySQL Qurey brower, you cannot execute multiple SQL commands at once, and execute SQL file commands in MySQL:
Copy Code code as follows:
Mysql> source D:/myprogram/database/db.sql;
First look at the section MySQL query article reply statement:
Copy Code code as follows:
#查询文章回复
-- ----------------------------
--Procedure structure for ' sp_select_reply_article '
-- ----------------------------
DROP PROCEDURE
BLOB data type in MySQL
A blob is a binary large object that is used to store variable amounts of data. Blob types are divided into 4 kinds: tinyblob, blobs, Mediumblob, Longblob,
The only difference between these types is that they differ in the
Let's look at the width range of the integer data type first.
Create a table
Copy Code code as follows:
CREATE TABLE tb_emp (id BIGINT (1))
The ID field has a data type of bigint (1), noting the following number 1, which
picture, file, binary data never put in MySQL database。Many people feel that since the database supports BLOB-type data, it's definitely not wrong to cram files into a BLOB field!? Wrong, not like this! Otherwise, in many database languages, it is
Ever thought in my.cnf write max_connections = 2000You can change the maximum concurrency of MySQL, a command today, found that the server's MySQL maximum number of connections to 151.
console, connecting to MySQL
Copy Code code as follows:
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