찾다
데이터 베이스MySQL 튜토리얼linux下数据库双向同步之mysql

linux下数据库双向同步之mysql

Jun 07, 2016 pm 02:52 PM
lamplinuxmysql동기식데이터 베이스환경

环境:lamp 下搭建一个博客 然后实现同步 这里:以wordpress为例,进行实施 具体操作如下: 一、环境配置 1.自动获取ip地址,虚拟机设置为桥接 650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="i

环境:lamp 下搭建一个博客   然后实现同步

这里:以wordpress为例,进行实施

具体操作如下:

一、环境配置

1.自动获取ip地址,虚拟机设置为桥接

image

2.[root@gjpslave ~]# yum install wget

#换成163的yum源:

cd /etc/yum.repos.d

mv CentOS-Base.repo CentOS-Base.repo.save

wget mirrors.163.com/.help/CentOS5-Base-163.repo

#wget mirrors.163.com/.help/CentOS6-Base-163.repo

sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf

cat /dev/null > /var/cache/yum/timedhosts.txt

yum clean all

yum makecache

3.yum -y install gcc* gcc-c++ rpm-build mysql* httpd* php* ppp openldap-devel lrzsz pam-devel wget net-snmp* ntp openssl* libgssapi* iptraf libtool-ltdl* libtool crontabs libpcap* flex byacc libpcap ncurses ncurses-devel automake autoconf libtool make traceroute wget scp openssh* setuptool mlocate pam.i686 openssl.i686 libgcrypt.i686 openssl098e.i686 glibc.i686 fping nload iftop iperf chkconfig unrar --skip-broken 

yum -y update

4.系统安全

到dnspod.cn上为新的服务器指定域名

hostname xx 命名主机名

#### security ###

arp -a|grep $(/sbin/route -n|awk '$1=="0.0.0.0"{print $2}')|awk '{print $2 " " $4}'|sed 's#(##g'|sed 's#)##g' > /etc/ethers && arp -f

echo "SELINUX=disabled" > /etc/sysconfig/selinux

echo "SELINUXTYPE=targeted" >> /etc/sysconfig/selinux

setenforce 0

echo "HISTSIZE=5" >> /root/.bash_profile

chkconfig --level 2345 hplip off

chkconfig --level 2345 rpcidmapd off

chkconfig --level 2345 cups off

chkconfig --level 2345 portmap off

chkconfig --level 2345 yum-updatesd off

chkconfig --level 2345 iptables off

chkconfig --level 2345 sendmail off

killall cupsd portmap rpc.statd

service iptables stop

service yum-updatesd stop

service sendmail stop

echo "Port 2121" >> /etc/ssh/sshd_config

echo "ClientAliveInterval 9999" >> /etc/ssh/sshd_config

service sshd restart

 

二、博客搭建 wordpress

wget    http://cn.wordpress.org/wordpress-3.9-zh_CN.tar.gz

tar zxvf  http://cn.wordpress.org/wordpress-3.9-zh_CN.tar.gz

[root@gjpmaster tmp]# ls

hsperfdata_root  wordpress  wordpress-3.9-zh_CN.tar.gz  yum.log  yum_save_tx-2013-08

[root@gjpmaster tmp]# cp -a wordpress/*  /var/www/html/

[root@gjpmaster ~]# useradd -d /var/www/html/  -s /sbin/nologin  gjpmaster

useradd: warning: the home directory already exists.

Not copying any file from skel directory into it.

[root@gjpmaster ~]# passwd  gjpmaster

Changing password for user gjpmaster.

New password:   123456

BAD PASSWORD: it is too simplistic/systematic

BAD PASSWORD: is too simple 

Retype new password:

passwd: all authentication tokens updated successfully.

mysql> create  database gjpmaster;

Query OK, 1 row affected (0.04 sec)

mysql> grant all on gjpmaster.* to gjpmaster@localhost identified by "gjpmaster321";

Query OK, 0 rows affected (0.00 sec)

[root@gjpmaster ~]# mysql -u gjpmaster -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit

Bye

[root@gjpmaster html]# cp -a wp-config-sample.php   wp-config.php

[root@gjpmaster html]# vi  wp-config.php

image

[root@gjpmaster html]# chmod  777 -R  wp-content/

[root@gjpmaster html]# vim /etc/httpd/conf/httpd.conf

     Options -Indexes

    RewriteEngine on

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

[root@gjpmaster html]# service httpd restart

Stopping httpd:                                            [  OK  ]

Starting httpd: httpd: apr_sockaddr_info_get() failed for gjpmaster

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

                                                           [  OK  ]

 

image

image

image

image

前台无法进入:

[root@gjpmaster html]# vim wp-includes/template-loader.php

image

 

三、ftp用来给博客上传下载东西

#安装  
yum -y install vsftpd    
#修改配置文件    
vi /etc/vsftpd/vsftpd.conf

#system

local_umask=022

pasv_enable=YES

connect_from_port_20=YES

local_enable=YES

write_enable=YES

use_localtime=YES

listen=YES

listen_port=21

#security

guest_enable=NO

pam_service_name=vsftpd

tcp_wrappers=YES

userlist_enable=YES

userlist_deny=NO

userlist_file=/etc/vsftpd/user_list

chroot_local_user=YES

#chroot_list_enable=YES

#chroot_list_file=/etc/vsftpd.chroot_list

#log

xferlog_enable=YES

xferlog_std_format=YES

xferlog_file=/var/log/vsftpd.log

#anonymous

anonymous_enable=NO

#max_per_ip=13

#max_clients=50

#anon_world_readable_only=YES

#anon_other_write_enable=NO

#anon_mkdir_write_enable=NO

#anon_upload_enable=NO

no_anon_password=YES

#anon_max_rate=200000

#启动ftp

service vsftpd restart

#允许匿名登陆

修改配置文件 要有以下两条

no_anon_password=YES

anonymous_enable=YES

增加anonymous至/etc/vsftpd/user_list

#增加用户

两种情况 一种是有指定的目录分给指定的用户 如 将/var/ftp分给用户 wow 二是直接建立用户 目录就是/home/用户名

1.以将/var/ftp分配给wow为例

useradd -s /sbin/nologin -d /var/ftp wow      // /sbin/nologin 是安全配置 意思是这个用户无法使用ssh登陆仅能使用ftp登陆 -d后面跟的是指定给此用户的目录

passwd wow //修改wow的用户名

echo wow >> /etc/vsftpd/user_list  这里一定要用>> 否则会清空里面的原来存放的用户名 只有这个列表user_list内的用户名可以登陆ftp上传文件 所以每添加一个用户名都要写入此文件

2.建立一个test用户 可以自己上传或下载文件

usreadd -s /sbin/nologin test

passwd test

echo test >> /etc/vsftpd/user_list

3.如果服务器上有多个ftp 在使用ftp协议下载时只能有一个采用匿名的方式  其它的都要带账号密码 比如说 ftp://123:123@sh02.lonlife.net/hehe.zip 还有另外一种方式就是给用户配置一个单独的域名用于下载 这时需要修改 /etc/httpd/conf/httpd.conf 增加如下 并重启http服务就好了

    Options -Indexes

    DocumentRoot "/old/home/bf2comcn"   //ftp的目录

    ServerName ftp.bf2.com.cn   绑定的域名

    ErrorLog /var/log/httpd/bf2comcn_err.log

    CustomLog /var/log/httpd/bf2comcn.log combined

上面是例子,操作如下:

从设备:

[root@gjpslave html]# yum  install vsftpd  -y

[root@gjpslave vsftpd]# ls

ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh

[root@gjpslave vsftpd]# mv vsftpd.conf  vsftpd.conf.bak

[root@gjpslave vsftpd]# vim vsftpd.conf

-bash: vim: command not found

[root@gjpslave vsftpd]# vi vsftpd.conf

[root@gjpslave vsftpd]# service vsftpd restart

Shutting down vsftpd:                                      [  OK  ]

Starting vsftpd for vsftpd:                                [  OK  ]

[root@gjpslave vsftpd]# vi vsftpd.conf

[root@gjpslave vsftpd]# vi /etc/vsftpd/user_list

[root@gjpslave vsftpd]# useradd -s /sbin/nologin  -d /var/www/html/ gjpslave

useradd: warning: the home directory already exists.

Not copying any file from skel directory into it.

[root@gjpslave vsftpd]# passwd gjpslave

Changing password for user gjpslave.

New password: 123456

[root@gjpslave vsftpd]# echo gjpslave >>/etc/vsftpd/user_list

[root@gjpslave vsftpd]# chmod 755 -R  /var/www/html/

[root@gjpslave vsftpd]# chown gjpslave:gjpslave  -R /var/www/html

后面将gjpslave还是改为gjpmaster了

image

 

四、数据库同步(单向)

从主站导入数据库

[root@gjpmaster www]# /usr/bin/mysqldump -u root -p gjpmaster>/tmp/20140528.sql;

从站从主站下载:

[root@gjpslave vsftpd]# scp -rP 22 10.0.7.112:/tmp/20140528.sql  /tmp/20140528.sql

root@10.0.7.112's password:

20140528.sql                                                                           100%  408KB 407.6KB/s   00:00 

mysql> create database gjpmaster;

Query OK, 1 row affected (0.03 sec)

mysql> use gjpmaster;

Database changed

mysql> source /tmp/20140528.sql;

Query OK, 18 rows affected (0.00 sec)

Records: 18  Duplicates: 0  Warnings: 0

image

同步好的数据

grant all on gjpmaster.* to gjpslave@localhost identified by "gjpmaster321";

由于上面账号设置成gjpslave 出错了,改为gjpmaster 和主站的一样,ok

image  

开始同步数据库:

grant replication slave on *.* to "gjpmaster"@"10.0.7.113" identified by "gjpmaster321";

[root@gjpmaster tmp]# vim /etc/my.cnf

[mysqld]

server-id=1

log-bin=mysql-bin

binlog-do-db=gjpmaster

binlog-ignore-db=mysql

[root@gjpmaster tmp]# service mysqld restart

Stopping mysqld:                                           [  OK  ]

Starting mysqld:                                           [  OK  ]

[root@gjpmaster tmp]# mysql -u root -p

mysql> show variables like 'server_id';

+---------------+-------+

| Variable_name | Value |

+---------------+-------+

| server_id     | 1     |

+---------------+-------+

1 row in set (0.00 sec)

mysql> show master status;

+------------------+----------+--------------+------------------+

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |

+------------------+----------+--------------+------------------+

| mysql-bin.000001 |      106 | gjpmaster    | mysql            |

+------------------+----------+--------------+------------------+

1 row in set (0.00 sec)

四、配置MySQL从服务器(192.168.21.129)的my.cnf文件

vi /etc/my.cnf   #编辑配置文件,在[mysqld]部分添加下面内容

server-id=2   #设置服务器id,修改其值为2,表示为从数据库

log-bin=mysql-bin  #启动MySQ二进制日志系统,注意:如果原来的配置文件中已经有这一行,就不用再添加了。

replicate-do-db=osyunweidb   #需要同步的数据库名,如果有多个数据库,可重复此参数,每个数据库一行

replicate-ignore-db=mysql   #不同步mysql系统数据库

read_only  #设置数据库只读

:wq!    #保存退出

service mysqld restart   #重启MySQL

mysql  -u root -p  #进入MySQL控制台

show variables like 'server_id';  #查看server-id的值,必须为上面设置的2,否则请返回修改配置文件

mysql> show variables like 'server_id';

+---------------+-------+

| Variable_name | Value |

+---------------+-------+

| server_id     | 2     |

+---------------+-------+

1 row in set (0.01 sec)

mysql> slave stop;

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> change master to  master_host='10.0.7.112',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000001',master_log_pos=106;

Query OK, 0 rows affected (0.05 sec)

change master to  master_host='10.0.7.112',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000002',master_log_pos=316;

mysql> slave start;

Query OK, 0 rows affected (0.01 sec)

mysql> SHOW SLAVE  STATUS\G

mysql> SHOW SLAVE  STATUS\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 10.0.7.112

                  Master_User: gjpmaster

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000001

          Read_Master_Log_Pos: 106

               Relay_Log_File: mysqld-relay-bin.000002

                Relay_Log_Pos: 251

        Relay_Master_Log_File: mysql-bin.000001

             Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

              Replicate_Do_DB: gjpmaster

          Replicate_Ignore_DB: mysql

           Replicate_Do_Table:

       Replicate_Ignore_Table:

      Replicate_Wild_Do_Table:

  Replicate_Wild_Ignore_Table:

                   Last_Errno: 0

                   Last_Error:

                 Skip_Counter: 0

          Exec_Master_Log_Pos: 106

              Relay_Log_Space: 407

              Until_Condition: None

               Until_Log_File:

                Until_Log_Pos: 0

           Master_SSL_Allowed: No

           Master_SSL_CA_File:

           Master_SSL_CA_Path:

              Master_SSL_Cert:

            Master_SSL_Cipher:

               Master_SSL_Key:

        Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

                Last_IO_Errno: 0

                Last_IO_Error:

               Last_SQL_Errno: 0

               Last_SQL_Error:

1 row in set (0.00 sec)

测试:

主设备创建个表test

mysql> CREATE TABLE test ( id int not null primary key,name char(20) );

Query OK, 0 rows affected (0.07 sec)

CREATE TABLE lzw( id int not null primary key,name char(18) );

从设备 

image

发表文章也是如此

 

wordpress迁移到其他服务器上 IP变动时候要修改以下信息.数据库里修改.

wp_options表:  
siteurl 要改成新的IPurl    
wp_posts表:

update wp_posts set post_content=replace(post_content,'192.168.100.151','10.0.0.23')  
update wp_posts set guid=replace(guid,'192.168.100.151','10.0.0.23')

 

这里具体操作如下:

update wp_posts set post_content=replace(post_content,'10.0.7.112','10.0.7.113')  
update wp_posts set guid=replace(guid,'10.0.7.112','10.0.7.113')

第一个域名是老域名  第二个是新的

UPDATE wp_options SET option_value=replace(option_value,'http://10.0.7.113', 'http://10.0.7.112') WHERE option_name='home' OR option_name='siteurl';

 

在这里,可安装phpmyadmin 对数据库进行管理

image

image

 

五、数据库的双向同步:

双向参考: http://www.linuxidc.com/Linux/2012-10/71593.htm

主站:

useradd  backup   passwd backup  123

mysql> grant file on *.* to backup@'10.0.7.113' identified by '123';

Query OK, 0 rows affected (0.00 sec)

   mysql>flush privileges;

在slave上测试账户backup是否可以访问mster上的mysql:

      #mysql -u backup -p -h 10.0.7.112(输入密码123,可以访问说明设置正确)

slave上也要建立账号 设密码

mysql> grant replication slave on *.* to "backup"@"10.0.7.113" identified by "123";

[root@gjpmaster ~]# cat /etc/my.cnf

[mysqld]

server-id=1

log-bin=mysql-bin

binlog-do-db=gjpmaster

binlog-ignore-db=mysql

max-binlog-size=104857600

master-host=10.0.7.113

master-user=backup

master-password=123

master-port=3306

replicate-do-db=gjpmaster

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[root@gjpmaster tmp]# service mysqld restart

mysql> slave stop;

mysql> change master to  master_host='10.0.7.113',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000002',master_log_pos=478;

change master to  master_host='10.0.0.139',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000002',master_log_pos=11395;

mysql> slave start;

mysql> show slave status\G;

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 10.0.7.113

                  Master_User: gjpmaster

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000002

          Read_Master_Log_Pos: 478

               Relay_Log_File: mysqld-relay-bin.000002

                Relay_Log_Pos: 251

        Relay_Master_Log_File: mysql-bin.000002

Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

从站:

mysql> grant replication slave on *.* to "gjpmaster"@"10.0.7.112" identified by "gjpmaster321";

[root@gjpslave html]# cat /etc/my.cnf

[mysqld]

server-id=2

log-bin=mysql-bin

binlog-do-db=gjpmaster

master-host=10.0.7.112

master-user=backup

master-password=123

master-port=3306

replicate-do-db=gjpmaster

#master-connect-retry=60

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

service mysqld restart

mysql> slave stop;

mysql>  change master to  master_host='10.0.7.112',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000002',master_log_pos=316;

change master to  master_host='10.0.0.139',master_user='gjpmaster', master_password='gjpmaster321',master_log_file='mysql-bin.000001',master_log_pos=106;

mysql> slave start;

mysql> SHOW SLAVE  STATUS\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 10.0.7.112

                  Master_User: gjpmaster

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000002

          Read_Master_Log_Pos: 628

               Relay_Log_File: mysqld-relay-bin.000002

                Relay_Log_Pos: 563

        Relay_Master_Log_File: mysql-bin.000002

             Slave_IO_Running: Yes

            Slave_SQL_Running: Yes

              Replicate_Do_DB: gjpmaster

use gjpmaster;

update wp_posts set post_content=replace(post_content,'10.0.7.112','10.0.7.113');  
update wp_posts set guid=replace(guid,'10.0.7.112','10.0.7.113');

第一个域名是老域名  第二个是新的

UPDATE wp_options SET option_value=replace(option_value,'http://10.0.7.112', 'http://10.0.7.113') WHERE option_name='home' OR option_name='siteurl';

 

最后同步成功

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
MySQL에서 느린 쿼리를 식별하고 최적화하는 방법은 무엇입니까? (느린 쿼리 로그, Performance_schema)MySQL에서 느린 쿼리를 식별하고 최적화하는 방법은 무엇입니까? (느린 쿼리 로그, Performance_schema)Apr 10, 2025 am 09:36 AM

MySQL 느린 쿼리를 최적화하려면 SlowQueryLog 및 Performance_Schema를 사용해야합니다. 1. SlowQueryLog 및 Set Stresholds를 사용하여 느린 쿼리를 기록합니다. 2. Performance_schema를 사용하여 쿼리 실행 세부 정보를 분석하고 성능 병목 현상을 찾고 최적화하십시오.

MySQL 및 SQL : 개발자를위한 필수 기술MySQL 및 SQL : 개발자를위한 필수 기술Apr 10, 2025 am 09:30 AM

MySQL 및 SQL은 개발자에게 필수적인 기술입니다. 1.MySQL은 오픈 소스 관계형 데이터베이스 관리 시스템이며 SQL은 데이터베이스를 관리하고 작동하는 데 사용되는 표준 언어입니다. 2.MYSQL은 효율적인 데이터 저장 및 검색 기능을 통해 여러 스토리지 엔진을 지원하며 SQL은 간단한 문을 통해 복잡한 데이터 작업을 완료합니다. 3. 사용의 예에는 기본 쿼리 및 조건 별 필터링 및 정렬과 같은 고급 쿼리가 포함됩니다. 4. 일반적인 오류에는 구문 오류 및 성능 문제가 포함되며 SQL 문을 확인하고 설명 명령을 사용하여 최적화 할 수 있습니다. 5. 성능 최적화 기술에는 인덱스 사용, 전체 테이블 스캔 피하기, 조인 작업 최적화 및 코드 가독성 향상이 포함됩니다.

MySQL 비동기 마스터 슬레이브 복제 프로세스를 설명하십시오.MySQL 비동기 마스터 슬레이브 복제 프로세스를 설명하십시오.Apr 10, 2025 am 09:30 AM

MySQL 비동기 마스터 슬레이브 복제는 Binlog를 통한 데이터 동기화를 가능하게하여 읽기 성능 및 고 가용성을 향상시킵니다. 1) 마스터 서버 레코드는 Binlog로 변경됩니다. 2) 슬레이브 서버는 I/O 스레드를 통해 Binlog를 읽습니다. 3) 서버 SQL 스레드는 데이터를 동기화하기 위해 Binlog를 적용합니다.

MySQL : 쉽게 학습하기위한 간단한 개념MySQL : 쉽게 학습하기위한 간단한 개념Apr 10, 2025 am 09:29 AM

MySQL은 오픈 소스 관계형 데이터베이스 관리 시스템입니다. 1) 데이터베이스 및 테이블 작성 : CreateAbase 및 CreateTable 명령을 사용하십시오. 2) 기본 작업 : 삽입, 업데이트, 삭제 및 선택. 3) 고급 운영 : 가입, 하위 쿼리 및 거래 처리. 4) 디버깅 기술 : 확인, 데이터 유형 및 권한을 확인하십시오. 5) 최적화 제안 : 인덱스 사용, 선택을 피하고 거래를 사용하십시오.

MySQL : 데이터베이스에 대한 사용자 친화적 인 소개MySQL : 데이터베이스에 대한 사용자 친화적 인 소개Apr 10, 2025 am 09:27 AM

MySQL의 설치 및 기본 작업에는 다음이 포함됩니다. 1. MySQL 다운로드 및 설치, 루트 사용자 비밀번호를 설정하십시오. 2. SQL 명령을 사용하여 CreateAbase 및 CreateTable과 같은 데이터베이스 및 테이블을 만듭니다. 3. CRUD 작업을 실행하고 삽입, 선택, 업데이트, 명령을 삭제합니다. 4. 성능을 최적화하고 복잡한 논리를 구현하기 위해 인덱스 및 저장 절차를 생성합니다. 이 단계를 사용하면 MySQL 데이터베이스를 처음부터 구축하고 관리 할 수 ​​있습니다.

InnoDB 버퍼 풀은 어떻게 작동하며 성능에 중요한 이유는 무엇입니까?InnoDB 버퍼 풀은 어떻게 작동하며 성능에 중요한 이유는 무엇입니까?Apr 09, 2025 am 12:12 AM

innodbbufferpool은 데이터와 색인 페이지를 메모리에로드하여 MySQL 데이터베이스의 성능을 향상시킵니다. 1) 데이터 페이지가 버퍼 풀에로드되어 디스크 I/O를 줄입니다. 2) 더러운 페이지는 정기적으로 디스크로 표시되고 새로 고침됩니다. 3) LRU 알고리즘 관리 데이터 페이지 제거. 4) 읽기 메커니즘은 가능한 데이터 페이지를 미리로드합니다.

MySQL : 초보자를위한 데이터 관리의 용이성MySQL : 초보자를위한 데이터 관리의 용이성Apr 09, 2025 am 12:07 AM

MySQL은 설치가 간단하고 강력하며 데이터를 쉽게 관리하기 쉽기 때문에 초보자에게 적합합니다. 1. 다양한 운영 체제에 적합한 간단한 설치 및 구성. 2. 데이터베이스 및 테이블 작성, 삽입, 쿼리, 업데이트 및 삭제와 같은 기본 작업을 지원합니다. 3. 조인 작업 및 하위 쿼리와 같은 고급 기능을 제공합니다. 4. 인덱싱, 쿼리 최적화 및 테이블 파티셔닝을 통해 성능을 향상시킬 수 있습니다. 5. 데이터 보안 및 일관성을 보장하기위한 지원 백업, 복구 및 보안 조치.

MySQL에서 인덱스를 사용하는 것보다 전체 테이블 스캔이 더 빠를 수 있습니까?MySQL에서 인덱스를 사용하는 것보다 전체 테이블 스캔이 더 빠를 수 있습니까?Apr 09, 2025 am 12:05 AM

전체 테이블 스캔은 MySQL에서 인덱스를 사용하는 것보다 빠를 수 있습니다. 특정 사례는 다음과 같습니다. 1) 데이터 볼륨은 작습니다. 2) 쿼리가 많은 양의 데이터를 반환 할 때; 3) 인덱스 열이 매우 선택적이지 않은 경우; 4) 복잡한 쿼리시. 쿼리 계획을 분석하고 인덱스 최적화, 과도한 인덱스를 피하고 정기적으로 테이블을 유지 관리하면 실제 응용 프로그램에서 최상의 선택을 할 수 있습니다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

WebStorm Mac 버전

WebStorm Mac 버전

유용한 JavaScript 개발 도구

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

SublimeText3 영어 버전

SublimeText3 영어 버전

권장 사항: Win 버전, 코드 프롬프트 지원!

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

DVWA

DVWA

DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는