??xml version="1.0" encoding="utf-8" standalone="yes"?>欧洲美女精品免费观看视频,在线观看视频免费一区二区三区,精品婷婷伊人一区三区三 http://www.aygfsteel.com/paulwong/category/53563.htmlzh-cnSun, 25 Oct 2020 16:23:09 GMTSun, 25 Oct 2020 16:23:09 GMT60install redhat rh-mariadb103http://www.aygfsteel.com/paulwong/archive/2020/10/24/435704.htmlpaulwongpaulwongSat, 24 Oct 2020 10:02:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/10/24/435704.htmlhttp://www.aygfsteel.com/paulwong/comments/435704.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/10/24/435704.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435704.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435704.html# Install MariaDB 10.3
yum install rh-mariadb103-mariadb-server rh-mariadb103-mariadb-server-utils -y

# Add MariaDB 10.3 to $PATH
scl enable rh-mariadb103 bash
source /opt/rh/rh-mariadb103/enable

# start 10.3 server
chown -R mysql:mysql /var/opt/rh/rh-mariadb103/lib/mysql;
systemctl start rh-mariadb103-mariadb

# Upgrade tables
mysql_upgrade -p[PASSWORD]

# Set 10.3 to start on boot
systemctl enable rh-mariadb103-mariadb

# Add 10.3 to paths on reboot (and remove 10.2) 
rm /etc/profile.d/rh-mariadb102.sh
cp /opt/rh/rh-mariadb103/enable /etc/profile.d/rh-mariadb103.sh

# increase max connections number
systemctl edit rh-mariadb103-mariadb
[Service]
LimitNOFILE=65535
LimitNPROC=65535

vi /etc/opt/rh/rh-mariadb103/my.cnf
[mysqld]
max_connections=1000
open_files_limit=65535

# restart mariadb103
systemctl daemon-reload
systemctl restart rh-mariadb103-mariadb

# check result
mysql -e 'show variables like "max_connections"'

https://www.server-world.info/en/note?os=CentOS_7&p=mariadb103&f=4


paulwong 2020-10-24 18:02 发表评论
]]>
MYSQLl典配置http://www.aygfsteel.com/paulwong/archive/2020/08/07/435635.htmlpaulwongpaulwongFri, 07 Aug 2020 10:01:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/08/07/435635.htmlhttp://www.aygfsteel.com/paulwong/comments/435635.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/08/07/435635.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435635.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435635.html
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#symbolic-links=0

#vish start
open_files_limit = 8000
max_connections = 500
#set-variable=max_connections=500
thread_concurrency = 8
#concurrent_insert=2
thread_cache_size=2000

interactive_timeout=180
wait_timeout=180

max_allowed_packet = 32M
key_buffer_size = 3000M
read_buffer_size = 16M
read_rnd_buffer_size = 4M
bulk_insert_buffer_size = 256M
myisam_sort_buffer_size = 16M
myisam_max_sort_file_size = 256M
myisam_repair_threads = 1
#myisam_recover = 4
max_heap_table_size = 2048M
tmp_table_size = 1024M
table_open_cache = 2000
table_cache = 2000
sort_buffer_size = 128M 
join_buffer_size = 128M 
query_cache_size = 128M 
query_cache_limit = 128M 

#slow_query_log=1
log-slow-queries
long_query_time=2
#log_queries_not_using_indexes=1
slow_query_log_file = /var/log/mariadb/host_name-slow.log

[mysqldump]
user=root
password=*********
#max_allowed_packet = 1024M 

[myisamchk] 
key_buffer_size = 2500M 
sort_buffer_size = 1024M 
read_buffer = 32M
write_buffer = 32M

[innodb]
innodb_buffer_pool_size=3G
innodb_buffer_pool_instance=2
innodb_additional_mem_pool_size=20M
innodb_log_file_size= 512M
innodb_log_buffer_size=16M
innodb_flush_log_at_trx_commit=1
innodb_thread_concurrency=16
#innodb_read_io_threads=16
#innodb_write_io_threads=16
#innodb_io_capacity=2000
#innodb_lock_wait_timeout=120

innodb_flush_method=O_DIRECT
#vish end

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
#!includedir /etc/my.cnf.d



paulwong 2020-08-07 18:01 发表评论
]]>
RHEL\CentOS 7 ?MySQL q接数被限制?14?/title><link>http://www.aygfsteel.com/paulwong/archive/2020/08/05/435628.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 05 Aug 2020 12:55:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2020/08/05/435628.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/435628.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2020/08/05/435628.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/435628.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/435628.html</trackback:ping><description><![CDATA[MARIADB的默认最大连接数?00Q当试图更改配置文g/etc/my.confq加max_connections=1000Qƈ重启服务Ӟ发现最大连接数被重|ؓ214Q这是由于系l问题,open_filesCؓ1024Q如何正地更改是个复杂的问题?br /> <br /> MARIADB中一些查当前q接?最大连接数的命令ؓQ?br /> <br /> <div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->MariaDB <span style="color: #800000; font-weight: bold; ">[</span><span style="color: #800000; ">(none)</span><span style="color: #800000; font-weight: bold; ">]</span>> <br /> show variables like "max_connections"<span style="color: #008000; ">;<br /> </span>show processlist<span style="color: #008000; ">;<br /> </span>show status where variable_name = 'threads_connected'<span style="color: #008000; ">;<br /> </span>show status where variable_name = 'max_used_connections'<span style="color: #008000; ">;<br /> </span>show variables like 'max_user_connections'<span style="color: #008000; ">;<br /> </span>show variables like '%connection%'<span style="color: #008000;">;</span></div> <br /> 正确ҎQ?br /> RHEL\CentOS 7 ?MySQL q接数被限制?14?br /> <a target="_blank">https://waylau.com/rhel-mysql-connections-limit-214/</a><br /> <br /> Centos7.4下面mysql的max_connections不生效的问题?br /> <a target="_blank">https://blog.51cto.com/wangqh/2131340</a><br /> <br /> Z要在SERVICE中添加允许打开的文件数Q?br /> Centos7下修?etc/security/limits.conf文g只在用户d后打开的进E有效,pȝ服务或通过rc.local启动的无效,pȝ服务修改文g/usr/lib/systemd/system/SOME_SERVICE.servicedQ?br /> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #800000; font-weight: bold; ">[</span><span style="color: #800000; ">Service</span><span style="color: #800000; font-weight: bold; ">]</span><br /> LimitNOFILE=65535</div><br /><br />关于LINUXpȝ的最大打开文g敎ͼ<br /><a target="_blank">https://blog.51cto.com/as007012/1956222</a><br /><br /><a target="_blank">https://www.haiyun.me/archives/linux-file-limit.html</a><br /><br /><img src ="http://www.aygfsteel.com/paulwong/aggbug/435628.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2020-08-05 20:55 <a href="http://www.aygfsteel.com/paulwong/archive/2020/08/05/435628.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MariaDB Galera Clusterhttp://www.aygfsteel.com/paulwong/archive/2020/05/09/435424.htmlpaulwongpaulwongSat, 09 May 2020 03:08:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/05/09/435424.htmlhttp://www.aygfsteel.com/paulwong/comments/435424.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/05/09/435424.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435424.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435424.htmlWhat is MariaDB Galera Cluster? https://mariadb.com/kb/en/what-is-mariadb-galera-cluster/

Prepare yum install repository:
https://downloads.mariadb.org/mariadb/repositories/#distro=CentOS&distro_release=centos7-amd64--centos7&mirror=coreix&version=10.4

MariaDB Galera Cluster部v实战
https://jeremyxu2010.github.io/2018/02/mariadb-galera-cluster%E9%83%A8%E7%BD%B2%E5%AE%9E%E6%88%98/

9 Tips for Going in Production with Galera Cluster for MySQL
https://severalnines.com/blog/9-tips-going-production-galera-cluster-mysql

HA for MySQL and MariaDB - Comparing Master-Master Replication to Galera Cluster
https://severalnines.com/database-blog/ha-mysql-and-mariadb-comparing-master-master-replication-galera-cluster

Galera Cluster for MySQL - Tutorial
https://severalnines.com/resources/tutorials/galera-cluster-mysql-tutorial












paulwong 2020-05-09 11:08 发表评论
]]>
List sessions / active connections on MariaDB serverhttp://www.aygfsteel.com/paulwong/archive/2020/04/02/435313.htmlpaulwongpaulwongThu, 02 Apr 2020 07:38:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/04/02/435313.htmlhttp://www.aygfsteel.com/paulwong/comments/435313.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/04/02/435313.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435313.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435313.htmlUsing a command

Option 1

show status where variable_name = 'threads_connected'; 

Columns

  • Variable_name - Name of the variable shown
  • Value - Number of active connections

Rows

  • One row: Only one row is displayed

Sample results

Option 2

show processlist; 

Columns

  • Id - The connection identifier
  • User - The MariaDB user who issued the statement
  • Host - Host name and client port of the client issuing the statement
  • db - The default database (schema), if one is selected, otherwise NULL
  • Command - The type of command the thread is executing
  • Time - The time in seconds that the thread has been in its current state
  • State - An action, event, or state that indicates what the thread is doing
  • Info - The statement the thread is executing, or NULL if it is not executing any statement
  • Progress - The total progress of the process (0-100%)

Rows

  • One row: represents one active connection
  • Scope of rows: total of active connections

Sample results

Using a query

Option 3

select id, user, host, db, command, time, state, 
info, progress from information_schema.processlist;

Columns

  • Id - The connection identifier
  • User - The MariaDB user who issued the statement
  • Host - Host name and client port of the client issuing the statement
  • db - The default database (schema), if one is selected, otherwise NULL
  • Command - The type of command the thread is executing
  • Time - The time in seconds that the thread has been in its current state
  • State - An action, event, or state that indicates what the thread is doing
  • Info - The statement the thread is executing, or NULL if it is not executing any statement
  • Progress - The total progress of the process (0-100%)
  • memory_used - Amount of memory used by the active connection

Rows

  • One row: represents one active connection
  • Scope of rows: total of active connections

Sample results

Using the GUI

Option 4

Click on the Client Connections option of the Management tab (left navigation pane)

This action will show the Client Connections screen containing the current active connections



paulwong 2020-04-02 15:38 发表评论
]]>
利用 Chef ?Red Hat Enterprise Linux 上自动化部v Mariadb Galera Clusterhttp://www.aygfsteel.com/paulwong/archive/2020/03/21/435289.htmlpaulwongpaulwongSat, 21 Mar 2020 02:55:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/03/21/435289.htmlhttp://www.aygfsteel.com/paulwong/comments/435289.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/03/21/435289.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435289.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435289.htmlhttps://www.ibm.com/developerworks/cn/linux/1611_chensz_mgc/index.html



paulwong 2020-03-21 10:55 发表评论
]]>
mySQL Error 1040: Too Many Connectionhttp://www.aygfsteel.com/paulwong/archive/2020/03/10/435247.htmlpaulwongpaulwongTue, 10 Mar 2020 12:20:00 GMThttp://www.aygfsteel.com/paulwong/archive/2020/03/10/435247.htmlhttp://www.aygfsteel.com/paulwong/comments/435247.htmlhttp://www.aygfsteel.com/paulwong/archive/2020/03/10/435247.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435247.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435247.html

To see how many connections are configured for your DB to use:

select @@max_connections;

To change it:

set global max_connections = 200;

To see how many are connected at the current time:

show processlist;
vi /etc/my.cnf

[mysqld]
max_connections = 500


paulwong 2020-03-10 20:20 发表评论
]]>
centos7 mysql数据库安装和配置http://www.aygfsteel.com/paulwong/archive/2019/06/14/433861.htmlpaulwongpaulwongFri, 14 Jun 2019 02:24:00 GMThttp://www.aygfsteel.com/paulwong/archive/2019/06/14/433861.htmlhttp://www.aygfsteel.com/paulwong/comments/433861.htmlhttp://www.aygfsteel.com/paulwong/archive/2019/06/14/433861.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/433861.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/433861.html https://www.cnblogs.com/starof/p/4680083.html 

https://www.daniloaz.com/en/how-to-create-a-user-in-mysql-mariadb-and-grant-permissions-on-a-specific-database/

https://huongdanjava.com/mysql-2

http://www.runoob.com/mysql/mysql-install.html

paulwong 2019-06-14 10:24 发表评论
]]>
MYSQL HA资源http://www.aygfsteel.com/paulwong/archive/2014/03/23/411397.htmlpaulwongpaulwongSun, 23 Mar 2014 14:51:00 GMThttp://www.aygfsteel.com/paulwong/archive/2014/03/23/411397.htmlhttp://www.aygfsteel.com/paulwong/comments/411397.htmlhttp://www.aygfsteel.com/paulwong/archive/2014/03/23/411397.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/411397.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/411397.htmlhttp://stackoverflow.com/questions/22495722/mysql-master-slave-replication-connect-to-master-even-for-read-queries-does-d








paulwong 2014-03-23 22:51 发表评论
]]>
数据库的防单Ҏ障和分表分库http://www.aygfsteel.com/paulwong/archive/2014/03/23/411390.htmlpaulwongpaulwongSun, 23 Mar 2014 13:27:00 GMThttp://www.aygfsteel.com/paulwong/archive/2014/03/23/411390.htmlhttp://www.aygfsteel.com/paulwong/comments/411390.htmlhttp://www.aygfsteel.com/paulwong/archive/2014/03/23/411390.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/411390.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/411390.html
服务端:
互责数据同步Q一台服务器专门做写操作Q其他服务器只做L作,即主从模式。当L务器DOWN机时Q会在从服务器中选出一台做L务器。在MONGODB中叫REPLICATION?/div>

客户端:
要判断当前与数据库的链接Q如果是L作,则用与从服务器的链接,如果是写操作Q则使用与主服务器的链接。这L判断一般是由驱动程序去做,配置的时候如果是MYSQLQ就要用REPLYCATION的驱动?/div>

如果数据库里的某张表数据太多Q会D单的查询会需时过长的问题。一般的Ҏ是限制每张表中不能放太多的数据,如第一个月的数据放一张表Q下一个月的数据放W二张表Q这U做法称为SHARDINGQ分表。但q样会导致查询的复杂性,如数据在W二张表Q则要具体指明表名,否则查不出数据。目前的数据库,可以事先指定分表的规则,q样查询的语句不需改变Q数据库端会自动判断数据在哪张表Q然后\由到那张表,L找数据然后返回给客户端。ORACLE叫分QMONGODB叫AUTO SHARDING?/div>

服务端:
需事先指定数据分表规则Q这h到查询语句时数据库就知道数据在哪张表中?/div>

客户端:
查询数据时无需再指定分名了


paulwong 2014-03-23 21:27 发表评论
]]>一些数据切分、缓存、rpc框架、nosqlҎ资料http://www.aygfsteel.com/paulwong/archive/2013/10/14/404954.htmlpaulwongpaulwongMon, 14 Oct 2013 02:14:00 GMThttp://www.aygfsteel.com/paulwong/archive/2013/10/14/404954.htmlhttp://www.aygfsteel.com/paulwong/comments/404954.htmlhttp://www.aygfsteel.com/paulwong/archive/2013/10/14/404954.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/404954.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/404954.html1、数据切?/span>

        1.1?a style="color: #108ac6;" target="_blank">mysql中间件研IӞAtlasQcobarQTDDLQ?/a> 

        1.2?a style="color: #108ac6;" target="_blank">利用 MySQL Proxy 实现数据切分及整?nbsp;

        1.3?a style="color: #108ac6;" target="_blank">ZMySQL分库分表Ҏ?nbsp;

        1.4?a style="color: #108ac6;" target="_blank">tddl和diamond  

2、缓?/p>

        2.1?a style="color: #108ac6;" target="_blank">java客户端三U方式操?nbsp;

        2.2?a style="color: #108ac6;" target="_blank">myibatis配置memcached评测 

        2.3?a style="color: #108ac6;" target="_blank">Memcached + Spring Caching 

        2.4?a style="color: #108ac6;" target="_blank">memcachedb-持久化存储的~存pȝ 

        2.5?a style="color: #108ac6;" target="_blank">memcachedb让memcache的数据持久化 

        2.6?a style="color: #108ac6;" target="_blank">淘宝kv~存框架tair 

        2.7?a style="color: #108ac6;" target="_blank">ibatis之扩展缓存ibatis-tair-cache 

3、rpc框架

        3.1?a style="color: #108ac6;">dubbo 

        3.2、hsf 未开?/p>

        3.3?a style="color: #108ac6;" target="_blank">服务框架HSF分析之一容器启动

4、noSql

        4.1?a style="color: #108ac6;" target="_blank">学习NoSQL数据库的必读资料 



paulwong 2013-10-14 10:14 发表评论
]]>Ubuntu下彻底卸载mysqlhttp://www.aygfsteel.com/paulwong/archive/2013/07/21/401807.htmlpaulwongpaulwongSun, 21 Jul 2013 13:24:00 GMThttp://www.aygfsteel.com/paulwong/archive/2013/07/21/401807.htmlhttp://www.aygfsteel.com/paulwong/comments/401807.htmlhttp://www.aygfsteel.com/paulwong/archive/2013/07/21/401807.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/401807.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/401807.html
1 sudo apt-get autoremove --purge mysql-server-5.0
2 sudo apt-get remove mysql-server
3 sudo apt-get autoremove mysql-server
4 sudo apt-get remove mysql-common (非常重要)
上面的其实有一些是多余的,q是按照序执行一?br />
清理D留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P


2、安?mysql

1 sudo apt-get install mysql-server
2 sudo apt-get install mysql-client
3 sudo apt-get install php5-mysql(安装php5-mysql 是将php和mysqlq接h ) 



一旦安装完成,MySQL 服务器应该自动启动。您可以在终端提C符后运行以下命令来?MySQL 服务器是否正在运行:

1 sudo netstat -tap | grep mysql

当您q行该命令时Q您可以看到cM下面的行Q?br />
tcp 0 0 localhost.localdomain:mysql *:* LISTEN -
如果服务器不能正常运行,您可以通过下列命o启动它:


1 sudo /etc/init.d/mysql restart

3、进入mysql

$mysql -uroot -p 理员密?/div> 配置 MySQL 的管理员密码Q?br />
1 sudo mysqladmin -u root password newpassword


4、恢复数据库

mysql -p < html5canvas-20130930-0816.sql 


http://www.yesky.com/187/1754687.shtml

TOMCAT数据?br />http://136589219.iteye.com/blog/1572214

paulwong 2013-07-21 21:24 发表评论
]]>mysql分表Q分区的区别和联p?/title><link>http://www.aygfsteel.com/paulwong/archive/2013/05/07/398903.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 07 May 2013 01:19:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2013/05/07/398903.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/398903.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2013/05/07/398903.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/398903.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/398903.html</trackback:ping><description><![CDATA[<p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><strong style="padding: 0px; margin: 0px;">一Q什么是mysql分表Q分?/strong></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">什么是分表Q从表面意思上看呢Q就是把一张表分成N多个表Q具体请?strong style="padding: 0px; margin: 0px;"><a target="_self" rel="nofollow" style="padding: 0px; margin: 0px; color: #4466bb; outline: 0px;">mysql分表?U方?/a></strong></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">什么是分区Q分区呢是把一张表的数据分成N多个区块Q这些区块可以在同一个磁盘上Q也可以在不同的盘上,具体请参?strong style="padding: 0px; margin: 0px;"><a target="_self" rel="nofollow" style="padding: 0px; margin: 0px; color: #4466bb; outline: 0px;">mysql分区功能详细介绍Q以及实?/a></strong></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><strong style="padding: 0px; margin: 0px;">二,mysql分表和分区有什么区别呢</strong></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><span style="padding: 0px; margin: 0px; color: #800080;"><strong style="padding: 0px; margin: 0px;">1Q实现方式上</strong></span></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">aQ,mysql的分表是真正的分表,一张表分成很多表后Q每一个小表都是完正的一张表Q都对应三个文gQ一?MYD数据文gQ?MYI索引文gQ?frm表结构文件?/p><div style="margin: 0px; font-family: Verdana, sans-serif, 宋体; line-height: normal; background-color: #ffffff;"><ol style="padding: 0px; margin: 0px 0px 10px 20px; list-style-position: inside;"><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">[root@BlackGhost test]# ls |grep user  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">alluser.MRG  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">alluser.frm  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user1.MYD  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user1.MYI  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user1.frm  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user2.MYD  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user2.MYI  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user2.frm  </span></li></ol></div><pre style="padding: 5px; margin-top: 10px; margin-bottom: 10px; line-height: 18px; font-size: 9pt; font-family: 'Courier New', Arial; border-width: 1px 1px 1px 5px; border-style: solid; border-color: #dddddd #dddddd #dddddd #6ce26c; background-color: #f6f6f6;">[root@BlackGhost test]# ls |grep user alluser.MRG alluser.frm user1.MYD user1.MYI user1.frm user2.MYD user2.MYI user2.frm</pre><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">单说明一下,上面的分表呢是利用了merge存储引擎Q分表的一U)Qalluser是总表Q下面有二个分表Quser1Quser2。他们二个都是独立的表,取数据的时候,我们可以通过总表来取。这里总表是没?MYD,.MYIq二个文件的Q也是_总表他不是一张表Q没有数据,数据都放在分表里面。我们来看看.MRG到底是什么东?/p><div style="margin: 0px; font-family: Verdana, sans-serif, 宋体; line-height: normal; background-color: #ffffff;"><ol style="padding: 0px; margin: 0px 0px 10px 20px; list-style-position: inside;"><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">[root@BlackGhost test]# cat alluser.MRG |more  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user1  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">user2  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">#INSERT_METHOD=LAST  </span></li></ol></div><pre style="padding: 5px; margin-top: 10px; margin-bottom: 10px; line-height: 18px; font-size: 9pt; font-family: 'Courier New', Arial; border-width: 1px 1px 1px 5px; border-style: solid; border-color: #dddddd #dddddd #dddddd #6ce26c; background-color: #f6f6f6;">[root@BlackGhost test]# cat alluser.MRG |more user1 user2 #INSERT_METHOD=LAST</pre><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">从上面我们可以看出,alluser.MRG里面存了一些分表的关系Q以及插入数据的方式。可以把总表理解成一个外壻I或者是联接池?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">bQ,分区不一P一张大表进行分区后Q他q是一张表Q不会变成二张表Q但是他存放数据的区块变多了?/p><div style="margin: 0px; font-family: Verdana, sans-serif, 宋体; line-height: normal; background-color: #ffffff;"><ol style="padding: 0px; margin: 0px 0px 10px 20px; list-style-position: inside;"><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">[root@BlackGhost test]# ls |grep aa  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa#P#p1.MYD  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa#P#p1.MYI  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa#P#p3.MYD  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa#P#p3.MYI  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa.frm  </span></li><li style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;">aa.par  </span></li></ol></div><pre style="padding: 5px; margin-top: 10px; margin-bottom: 10px; line-height: 18px; font-size: 9pt; font-family: 'Courier New', Arial; border-width: 1px 1px 1px 5px; border-style: solid; border-color: #dddddd #dddddd #dddddd #6ce26c; background-color: #f6f6f6;">[root@BlackGhost test]# ls |grep aa aa#P#p1.MYD aa#P#p1.MYI aa#P#p3.MYD aa#P#p3.MYI aa.frm aa.par</pre><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">从上面我们可以看出,aaq张表,分ؓ二个区,p1和p3Q本来是三个区,被我删了一个区。我们都知道一张表对应三个文g.MYD,.MYI,.frm。分区呢Ҏ一定的规则把数据文件和索引文gq行了分Ԍq多Z一?par文gQ打开.par文g后你可以看出他记录了Q这张表的分Z息,根分表中?MRG有点像。分区后Q还是一张,而不是多张表?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><span style="padding: 0px; margin: 0px; color: #800080;"><strong style="padding: 0px; margin: 0px;">2Q数据处理上</strong></span></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">aQ,分表后,数据都是存放在分表里Q总表只是一个外I存取数据发生在一个一个的分表里面。看下面的例子:</p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">select * from alluser where id='12'表面上看Q是对表alluserq行操作的,其实不是的。是对alluser里面的分表进行了操作?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">bQ,分区呢,不存在分表的概念Q分区只不过把存放数据的文g分成了许多小块,分区后的表呢Q还是一张表。数据处理还是由自己来完成?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><span style="padding: 0px; margin: 0px; color: #800080;"><strong style="padding: 0px; margin: 0px;">3Q提高性能?/strong></span></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">aQ,分表后,单表的ƈ发能力提高了Q磁盘I/O性能也提高了。ƈ发能力ؓ什么提高了呢,因ؓ查寻一ơ所q旉变短了,如果出现高ƈ发的话,总表可以Ҏ不同的查询,ƈ发压力分C同的表里面。磁盘I/O性能怎么搞高了呢Q本来一个非常大?MYD文g现在也分摊到各个表?MYD中去了?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">bQ,mysql提出了分区的概念Q我觉得想H破盘I/O瓉Q想提高盘的读写能力,来增加mysql性能?br style="padding: 0px; margin: 0px;" />在这一点上Q分区和分表的测重点不同Q分表重Ҏ存取数据Ӟ如何提高mysqlq发能力上;而分区呢Q如何突破磁盘的d能力Q从而达到提高mysql性能的目的?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><span style="padding: 0px; margin: 0px; color: #800080;"><strong style="padding: 0px; margin: 0px;">4Q,实现的难易度?/strong></span></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">aQ,分表的方法有很多Q用merge来分表,是最单的一U方式。这U方式根分区难易度差不多Qƈ且对E序代码来说可以做到透明的。如果是用其他分表方式就比分区麻烦了?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">bQ,分区实现是比较简单的Q徏立分Q根建^常的表没什么区别,q且对开代码端来说是透明的?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;"><strong style="padding: 0px; margin: 0px;">三,mysql分表和分区有什么联pd</strong></p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">1Q都能提高mysql的性高Q在高ƈ发状态下都有一个良好的表面?/p><p style="padding: 0px; margin: 0px 0px 15pt; line-height: 1.5; letter-spacing: 1px; font-family: Verdana, sans-serif, 宋体; background-color: #ffffff;">2Q分表和分区不矛盾,可以怺配合的,对于那些大访问量Qƈ且表数据比较多的表,我们可以采取分表和分区结合的方式Q如果mergeq种分表方式Q不能和分区配合的话Q可以用其他的分表试Q,讉K量不大,但是表数据很多的表,我们可以采取分区的方式等?/p><img src ="http://www.aygfsteel.com/paulwong/aggbug/398903.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2013-05-07 09:19 <a href="http://www.aygfsteel.com/paulwong/archive/2013/05/07/398903.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">߰</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Һ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">̩˳</a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">޶</a>| <a href="http://" target="_blank">ʩ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">γ</a>| <a href="http://" target="_blank">ʼ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">п</a>| <a href="http://" target="_blank">°Ͷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ָ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ຣʡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͨ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ŷ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͬ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">۳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¸</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>