|+---------------------------+24 rows in Set (0.00 sec)Well, we've learned some simple database operations, and then we're going to start creating our own databases, datasheets!Create a databaseSimple command:Create Database MyData;The result is:Query OK, 1 row Affected (0.00 sec)The prompt has been successful. Next we use the View Table command, show:Mysql> Show databases;+-----------
I just took the time to perform master-master synchronization for MySQL.
Write down the steps and update them at any time for any problems. Here, the database I synchronized is test.
1. Environment Description.
HOST: 192.168.0.231 ()
HOST: 192.168.0.20.( B)
MySQL version 5.1.21
2. Authorize the user.
A:
Mysql> grant replication slave, file on *. * To 'repl1' @ '192. 168.0.20.' identified
By '123 ';
Query OK, 0 rows affected (0.00 Sec)
Mysql> flush pr
5.6, we found that the alter column step is the same as the modify column step.
Mysql>Create Table Xs (name varchar (12), age int default 5 );Query OK, 0 rows affected (0.34 Sec)
Mysql>Insert into Xs values ('A', 4 );Query OK, 1 row affected (0.05 Sec)
Mysql>Set profiling = 1;Query OK, 0 rows affected, 1 warning (0.01 Sec)
Mysql>Alter table Xs modify age int not
/plainContent-Length: 12Connection: keep-aliveDate: Sun, 15 Dec 2013 15:00:15 GMTServer: gophr
$ Curl-sI http://go.fcgi.unix/| wc-c141
Start the engine
Use sysctl to configure the kernel
Configure Nginx
Configure Nginx vhosts
Start the service with www-data
Run the Benchmark Test
Benchmark Test GOMAXPROCS = 1Go standalone
# Wrk-t100-c5000-d30s http: // 127.0.0.1: 8080/Running 30 s test @ http: // 127.0.0.1: 8080/100 threads and 5000 connectionsThread Stats Avg Stdev Max ++/-StdevLatency 11
Counter is a data indicator that describes the performance of servers or operating systems. Counters play a key role in performance testing, especially when analyzing the scalability of the system and locating performance bottlenecks, the Analysis of counter values is critical. However, it must be noted that a single performance counter can only reflect one aspect of the system performance, and the analysis of the performance test results must be based on multiple different counters.
Another ter
encoded, MySQL's character-set-client is configured as GBK, and the table structure is charset = utf8, there will be no doubt there will be garbled characters.
Here we will give a simple demonstration of this situation:
Master [localhost] {msandbox} (test)> create table charset_test_utf8 (id int primary key auto_increment, char_col varchar (50) charset = utf8; Query OK, 0 rows affected (0.04 sec) master [localhost] {msandbox} (test)> set names gbk
Mysqlusetest1; ReadingtableinformationforcompletionoftableandcolumnnamesYoucanturnoffthisfeaturetogetaquickerstartupwith-ADatabasechangemysql
mysql> use test1;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changemysql> select * from emp;+------------+----------+------+--------+| ename | hiredate | sal | deptno |+------------+----------+------+--------+| aaaaa | NULL | NULL | 1 || ccccccc
MASTER-MASTER cyclic synchronization from the MASTER node of MYSQL to the MASTER node.
However, being prepared will have a certain impact on performance!
Write down the steps and update them at any time for any problems. Here, the database I synchronized is TEST.
1. environment description.
Host: 192.168.0.231 ()
Host: 192.168.0.20.( B)
MYSQL version 5.1.21
2. authorize the user.
A:
Mysql> grant replication slave, file on *. * to 'repl1' @ '192. 168.0.20.' identified
By '123 ';
Query OK, 0 rows
MySQL basics 06 data type (6) type conversion, mysql Data Type1.Cast () Usage
In MySQL, cast (value as target type) syntax can be used for conversion of most types.
Cast must be followed by left parentheses:
Mysql> select cast (123 as char );
+ ------------------- +
| Cast (123 as char) |
+ ------------------- +
| 1, 123 |
+ ------------------- +
1 row in set (0.00 sec)
An error is reported when there is a space between cast and left parentheses:
My
Just took the time to do a little MySQL master synchronization.Write down the steps, and as to what will happen, update at any time. The database I synchronized here is test1, environment description.Host: 192.168.0.231 (A)Host: 192.168.0.232 (B)MYSQL version for 5.1.212, authorized users.A:Mysql> Grant replication Slave,file on *.* to ' repl1 ' @ ' 192.168.0.232 ' identifiedBy ' 123456 ';Query OK, 0 rows Affected (0.00 sec)mysql> flush Privileges;Que
files have been written to:/root/mysql-5.5.34-spider-3.2-vp-1.1-hs-1.2-q4m-0.95
==> Solution Yum Install Bison
4. Initialize the environment before starting:
#根据实际情况调整
/usr/local/mysql/scripts/mysql_install_db \--DEFAULTS-FILE=/ETC/MY.CNF \--basedir=/usr/local/mysql \--datadir=/usr/local/mysql/data \--user=mysql
5. Choose one of the ways to start (here Mysql.server)
Modify the variables inside the Mysql.server
Basedir=/usr/local/mysqlDatadir=/usr/local/mysql/data
#修改完成后./mysql.server Start Lib
Master-Slave synchronous maintenance
Due to special circumstances, the main server updates frequently, from the server due to a variety of reasons, resulting in a particularly slow update, this situation, we need to regularly master and slave data synchronization maintenance, the specific methods are as follows, in the low load time temporarily blocking the main database update, forcing the master-slave database update synchronization
Action 1, execute the following statement on master:
Mysql>
{7 size_t Fir = 0, sec = pos;8 while (Fir 9 {Ten while (Fir size_t maxmove = 0;(Sec T_exchange ( V[fir], Sec-fir, sec-fir-maxmove);Fir + = Maxmove;15}16}where T is an array, size is an array dimension, and POS is the location of the merge Division. that is, [0,pos] and [POS, size] are ordered respectively. For example
or interchange table
Auto_increment will happen reset
Specific operation:PT is a partitioned table, p is a partition or sub-partition1. Swap partitions with non-partitioned tablesCREATE TABLE e (
id INT NOT NULL,
fname VARCHAR(30),
lname VARCHAR(30)
)
PARTITION BY RANGE (id) (
PARTITION p0 VALUES LESS THAN (50),
PARTITION p1 VALUES LESS THAN (100),
PARTITION p2 VALUES LESS THAN (150),
PARTITION p3 VALUES LESS THA
password displayed in the database is saved in the form of ciphertext, greatly enhanced securitymysql> select User,authentication_string,Host from user;+-----------+-------------------------------------------+-----------+| User | authentication_string | Host |+-----------+-------------------------------------------+-----------+| root | *0DB339632B48910F8F0BEF61BD7EAD4441267E6E | localhost || mysql.sys | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | localhost |+-
steps, as long as two or more than two of the code is inconsistent, there is a possibility of codec error. If a lossless encoding conversion between the two character sets of the difference is not possible (described in more detail below), garbled characters are bound to occur. For example: Our shell is UTF8 encoding, MySQL character-set-client configuration into a GBK, and the table structure is charset=utf8 , then there will undoubtedly be garbled.So here's a quick demonstration of the situat
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.