热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MySQL-5.6+MySQL-Proxy构建主从复制与读写分离_MySQL

MySQL-5.6+MySQL-Proxy构建主从复制与读写分离
环境:

系统:CentOS-6.5

MySQL-master

IP:192.168.1.10

MySQL-slave

IP:192.168.1.11

Proxry

IP:192.167.1.12

——安装MySQL

1)创建mysql用户

[root@mater ~]# mysql -M -s /sbin/nologin mysql

[root@master ~]# yum install gcc gcc-c++ autoconf automake ncurses-devel libtool-ltdl-devel* libaio libaio-devel -y

3)解压安装MySQL [这里下载的是免安装版本]

[root@master linux]# tar fzvx mysql-5.6.16-linux-x86_64.tar.gz -C /usr/local/

[root@master linux]# mv mysql-5.6.16-linux-x86_64 mysql

[root@master local]# cd mysql/

[root@master mysql]# chown -R root:mysql .

[root@master mysql]# chown -R mysql:mysql data/

[root@master mysql]# ./scripts/mysql_install_db --user=mysql /

> --basedir=/usr/local/mysql/ /

> --datadir=/usr/local/mysql/data/

WARNING: The host 'master' could not be looked up with /usr/local/mysql//bin/resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...2014-04-26 19:57:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-04-26 19:57:06 1258 [Note] InnoDB: Using atomics to ref count buffer pool pages

2014-04-26 19:57:06 1258 [Note] InnoDB: The InnoDB memory heap is disabled

2014-04-26 19:57:06 1258 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2014-04-26 19:57:06 1258 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-04-26 19:57:06 1258 [Note] InnoDB: Using Linux native AIO

2014-04-26 19:57:06 1258 [Note] InnoDB: Using CPU crc32 instructions

2014-04-26 19:57:06 1258 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-04-26 19:57:07 1258 [Note] InnoDB: Completed initialization of buffer pool

2014-04-26 19:57:07 1258 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2014-04-26 19:57:07 1258 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2014-04-26 19:57:07 1258 [Note] InnoDB: Database physically writes the file full: wait...

2014-04-26 19:57:07 1258 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2014-04-26 19:57:11 1258 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2014-04-26 19:57:15 1258 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-04-26 19:57:15 1258 [Warning] InnoDB: New log files created, LSN=45781

2014-04-26 19:57:15 1258 [Note] InnoDB: Doublewrite buffer not found: creating new

2014-04-26 19:57:15 1258 [Note] InnoDB: Doublewrite buffer created

2014-04-26 19:57:15 1258 [Note] InnoDB: 128 rollback segment(s) are active.

2014-04-26 19:57:15 1258 [Warning] InnoDB: Creating foreign key constraint system tables.

2014-04-26 19:57:16 1258 [Note] InnoDB: Foreign key constraint system tables created

2014-04-26 19:57:16 1258 [Note] InnoDB: Creating tablespace and datafile system tables.

2014-04-26 19:57:16 1258 [Note] InnoDB: Tablespace and datafile system tables created.

2014-04-26 19:57:16 1258 [Note] InnoDB: Waiting for purge to start

2014-04-26 19:57:16 1258 [Note] InnoDB: 5.6.16 started; log sequence number 0

2014-04-26 19:57:16 1258 [Note] RSA private key file not found: /usr/local/mysql/data//private_key.pem. Some authentication plugins will not work.

2014-04-26 19:57:16 1258 [Note] RSA public key file not found: /usr/local/mysql/data//public_key.pem. Some authentication plugins will not work.

2014-04-26 19:57:17 1258 [Note] Binlog end

2014-04-26 19:57:17 1258 [Note] InnoDB: FTS optimize thread exiting.

2014-04-26 19:57:17 1258 [Note] InnoDB: Starting shutdown...

2014-04-26 19:57:19 1258 [Note] InnoDB: Shutdown completed; log sequence number 1625977

OK

Filling help tables...2014-04-26 19:57:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2014-04-26 19:57:19 1281 [Note] InnoDB: Using atomics to ref count buffer pool pages

2014-04-26 19:57:19 1281 [Note] InnoDB: The InnoDB memory heap is disabled

2014-04-26 19:57:19 1281 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2014-04-26 19:57:19 1281 [Note] InnoDB: Compressed tables use zlib 1.2.3

2014-04-26 19:57:19 1281 [Note] InnoDB: Using Linux native AIO

2014-04-26 19:57:19 1281 [Note] InnoDB: Using CPU crc32 instructions

2014-04-26 19:57:19 1281 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2014-04-26 19:57:19 1281 [Note] InnoDB: Completed initialization of buffer pool

2014-04-26 19:57:19 1281 [Note] InnoDB: Highest supported file format is Barracuda.

2014-04-26 19:57:19 1281 [Note] InnoDB: 128 rollback segment(s) are active.

2014-04-26 19:57:19 1281 [Note] InnoDB: Waiting for purge to start

2014-04-26 19:57:19 1281 [Note] InnoDB: 5.6.16 started; log sequence number 1625977

2014-04-26 19:57:19 1281 [Note] RSA private key file not found: /usr/local/mysql/data//private_key.pem. Some authentication plugins will not work.

2014-04-26 19:57:19 1281 [Note] RSA public key file not found: /usr/local/mysql/data//public_key.pem. Some authentication plugins will not work.

2014-04-26 19:57:19 1281 [Note] Binlog end

2014-04-26 19:57:19 1281 [Note] InnoDB: FTS optimize thread exiting.

2014-04-26 19:57:19 1281 [Note] InnoDB: Starting shutdown...

2014-04-26 19:57:21 1281 [Note] InnoDB: Shutdown completed; log sequence number 1625987

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/local/mysql//bin/mysqladmin -u root password 'new-password'

/usr/local/mysql//bin/mysqladmin -u root -h master password 'new-password'

Alternatively you can run:

/usr/local/mysql//bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; /usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/local/mysql//my.cnf and

will be used by default by the server when you start it.

You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

--defaults-file argument to mysqld_safe when starting the server.


4)复制配置文件并设置启动脚本

[root@node1 mysql]# cp my.cnf /etc/my.cnf

cp:是否覆盖"/etc/my.cnf"? y

[root@node1 mysql]# cp support-files/mysql.server /etc/init.d/mysqld[root@master mysql]# chmod +x /etc/init.d/mysqld

[root@master mysql]# chkconfig --add mysqld

[root@master mysql]# chkconfig mysqld on

[root@master mysql]# mkdir /usr/local/mysql/logs

[root@master mysql]# chown -R mysql:mysql /usr/local/mysql/logs/

[root@master mysql]# vi /etc/my.cnf

[mysqld]

#开启二进制日志

log-bin = /usr/local/mysql/logs/sql-bin

#唯一编号 [一般取IP的后两位]

server_id = 10

[root@master mysql]# vi /etc/profile.d/mysql.sh

PATH=$PATH:/usr/local/mysql/bin:

[root@master mysql]# source /etc/profile

[root@master mysql]# service mysqld start

Starting MySQL............ SUCCESS!

[root@master mysql]# netstat -antup |grep 3306

tcp 0 0 :::3306 :::* LISTEN 1768/mysqld

#salve步骤一样,这里省略...

1)在master上的MySQL创建相关用户

[root@node1 mysql]# mysql -u root

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

Your MySQL connection id is 1

Server version: 5.6.16-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2014,Oracleand/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> grant replication slave on *.* to 'repl'@'192.168.1.11' identified by '12345';

Query OK, 0 rows affected (1.49 sec)

mysql> show master status;

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

| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |

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

| sql-bin.000001 | 120 | | | |

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

1 row in set (0.12 sec)

[root@slave ~]# mysql -u root

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

Your MySQL connection id is 3

Server version: 5.5.25-log Source distribution

Copyright (c) 2000, 2011, 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> change master to[root@slave1 ~]# mysql -u root

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

Your MySQL connection id is 3

Server version: 5.5.25-log Source distribution

Copyright (c) 2000, 2011, 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> change master to

-> master_host='192.168.1.254',

-> master_user='repl',

-> master_password='12345',

-> master_log_file='sql-bin.000001',

-> master_log_pos=120;

Query OK, 0 rows affected (0.25 sec)


4)启动slave检测是否同步成功

mysql> start slave;

Query OK, 0 rows affected (0.00 sec)

mysql> show slave status/G;

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

Slave_IO_State: Waiting for master to send event

Master_Host: 192.168.1.10

Master_User: repl

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: sql-bin.000001

Read_Master_Log_Pos: 120

Relay_Log_File: node2-relay-bin.000002

Relay_Log_Pos: 281

Relay_Master_Log_File: sql-bin.000001

Slave_IO_Running: Yes #为Yes说明成功

Slave_SQL_Running: Yes #为Yes说明成功

Replicate_Do_DB:

Replicate_Ignore_DB:

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: 120

Relay_Log_Space: 454

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:

Replicate_Ignore_Server_Ids:

Master_Server_Id: 10

Master_UUID: 8c55a12b-cd22-11e3-bc81-0050563f4084

Master_Info_File: /usr/local/mysql/data/master.info

SQL_Delay: 0

SQL_Remaining_Delay: NULL

Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

Master_Retry_Count: 86400

Master_Bind:

Last_IO_Error_Timestamp:

Last_SQL_Error_Timestamp:

Master_SSL_Crl:

Master_SSL_Crlpath:

Retrieved_Gtid_Set:

Executed_Gtid_Set:

Auto_Position: 0

1 row in set (0.05 sec)

ERROR:

No query specified

1)在master创建一个数据表

mysql> create database user;

Query OK, 1 row affected (0.10 sec)

mysql> create table user.test1(id int);

Query OK, 0 rows affected (0.80 sec)

mysql> insert into user.test1 values(1);

Query OK, 1 row affected (0.12 sec)

mysql> insert into user.test1 values(2);

Query OK, 1 row affected (0.15 sec)

mysql> select * from user.test1;

+------+

| id |

+------+

| 1 |

| 2 |

+------+

2 rows in set (0.02 sec)

mysql> show databases;

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

| Database |

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

| information_schema |

| mysql |

| performance_schema |

| test |

| user |

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

5 rows in set (0.34 sec)

mysql> select * from user.test1;

+------+

| id |

+------+

| 1 |

| 2 |

+------+

2 rows in set (0.04 sec)

#说明同步完成。

1)创建相关用户和组

[root@Proxy ~]# groupadd -g 3306 mysql-proxy

[root@Proxy ~]# useradd -u 3306 -g mysql-proxy -s /sbin/nologin -M mysql-proxy


2)编译安装mysql-proxy

[root@Proxy ~]# cd /Linux/

[root@Proxy Linux]# tar zfvx mysql-proxy-0.8.3-linux-rhel5-x86-64bit.tar.gz -C /usr/local/

[root@Proxy local]# mv mysql-proxy-0.8.3-linux-rhel5-x86-64bit/ mysql-proxy

[root@Proxy local]# cd mysql-proxy/

[root@Proxy mysql-proxy]# chown -R root:mysql-proxy .


3)设置mysql-proxy环境变量

[root@Proxy mysql-proxy]# vi /etc/profile.d/mysql-proxy.sh

export PATH=$PATH:/usr/local/mysql-proxy/bin

[root@Proxy mysql-proxy]# source /etc/profile

[root@Proxy mysql-proxy]# mysql-proxy --daemon --log-level=debug /

--log-file=/var/log/mysql-proxy.log --plugins="proxy" /

--proxy-backend-addresses="192.168.1.10:3306" /

--proxy-read-only-backend-addresses="192.168.1.11:3306"


5)查看是否启动[默认端口4040]

[root@Proxy mysql-proxy]# netstat -antup|grep 4040

tcp 0 0 0.0.0.0:4040 0.0.0.0:* LISTEN 1326/mysql-proxy


6)客户端测试连接[Proxy IP 地址]

[root@slave ~]# mysql -uuser -p -h192.168.1.12 --port=4040

Enter password:

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

Your MySQL connection id is 5

Server version: 5.5.25-log Source distribution

Copyright (c) 2000, 2011, 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> show databases;

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

| Database |

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

| information_schema |

| mysql |

| performance_schema |

| test |

| user |

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

[root@Proxy mysql-proxy]# killall mysql-proxy

[root@Proxy mysql-proxy]# netstat -antup |grep 4040

[root@Proxy mysql-proxy]# cd /usr/local/mysql-proxy

[root@Proxy mysql-proxy]# cp lib/mysql-proxy/lua/admin.lua share/doc/mysql-proxy/

——启动mysql-proxy

[root@Proxy mysql-proxy]# mysql-proxy --daemon --log-level=debug /

--log-file=/var/log/mysql-proxy.log --plugins="proxy" /

--proxy-backend-addresses="192.168.1.10:3306"

--proxy-read-only-backend-addresses="192.168.1.11:3306" /

--proxy-lua-script="/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua" /

--plugins=admin --admin-username="admin" /

--admin-password="admin" /

--admin-lua-script="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"

[root@Proxy mysql-proxy]# mysql-proxy --daemon --log-level=debug /

--log-file=/var/log/mysql-proxy.log --plugins="proxy" /

--proxy-backend-addresses="192.168.1.252:3306"

--proxy-read-only-backend-addresses="192.168.1.254:3306" /

--proxy-lua-script="/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua" /

--plugins=admin --admin-username="admin" /

--admin-password="admin" /

--admin-lua-script="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"

客户端执行

[root@node1 /]# mysql -uuser -p12345 -h192.168.1.10 --port=4040 -e "select user from mysql.user;"

[root@node2 /]# mysql -uuser -p12345 -h192.168.1.11 --port=4040 -e "create database user1;"


10)优化配置启动脚本,并修连接端口

[root@Proxy mysql-proxy]# vi /etc/sysconfig/mysql-proxy

ADMIN_USER="admin"

ADMIN_PASSWORD="admin"

ADMIN_ADDRESS=""

ADMIN_LUA_SCRIPT="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"

PROXY_ADDRESS="0.0.0.0:3306"

PROXY_USER="mysql-proxy"

PROXY_OPTIOnS="--daemon --log-level=info --log-file="/var/log/mysql-proxy.log"

--plugins=proxy --plugins=admin --proxy-backend-addresses=192.168.1.12:3306

--proxy-read-only-backend-addresses=192.168.1.13:3306

--proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua"

[root@Proxy mysql-proxy]# vi /etc/init.d/mysql-proxy

#!/bin/bash

#

# mysql-proxy This script starts and stops the mysql-proxy daemon

#

# chkconfig: - 78 30

# processname: mysql-proxy

# description: mysql-proxy is a proxy daemon for mysql

# Source function library.

. /etc/rc.d/init.d/functions

prog="/usr/local/mysql-proxy/bin/mysql-proxy"

# Source networking configuration.

if [ -f /etc/sysconfig/network ]; then

. /etc/sysconfig/network

fi

# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0

# Set default mysql-proxy configuration.

ADMIN_USER="admin"

ADMIN_PASSWD="admin"

ADMIN_LUA_SCRIPT="/usr/local/mysql-proxy/share/doc/mysql-proxy/admin.lua"

PROXY_OPTIOnS="--daemon"

PROXY_PID=/var/run/mysql-proxy.pid

PROXY_USER="mysql-proxy"

# Source mysql-proxy configuration.

if [ -f /etc/sysconfig/mysql-proxy ]; then

. /etc/sysconfig/mysql-proxy

fi

RETVAL=0

start() {

echo -n $"Starting $prog: "

daemon $prog $PROXY_OPTIONS --pid-file=$PROXY_PID

--proxy-address="$PROXY_ADDRESS" --user=$PROXY_USER

--admin-username="$ADMIN_USER" --admin-lua-script="$ADMIN_LUA_SCRIPT"

--admin-password="$ADMIN_PASSWORD"

RETVAL=$?

echo

if [ $RETVAL -eq 0 ]; then

touch /var/lock/subsys/mysql-proxy

fi

}

stop() {

echo -n $"Stopping $prog: "

killproc -p $PROXY_PID -d 3 $prog

RETVAL=$?

echo

if [ $RETVAL -eq 0 ]; then

rm -f /var/lock/subsys/mysql-proxy

rm -f $PROXY_PID

fi

}

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

restart)

stop

start

;;

condrestart|try-restart)

if status -p $PROXY_PIDFILE $prog >&/dev/null; then

stop

start

fi

;;

status)

status -p $PROXY_PID $prog

;;

*)

echo "Usage: $0 {start|stop|restart|reload|status|condrestart|try-restart}"

RETVAL=1

;;

esac

exit $RETVAL

MySQL Proxy 的详细介绍:请点这里
MySQL Proxy 的下载地址:请点这里

推荐阅读
  • PHP组合工具以及开发所需的工具
    本文介绍了PHP开发中常用的组合工具和开发所需的工具。对于数据分析软件,包括Excel、hihidata、SPSS、SAS、MARLAB、Eview以及各种BI与报表工具等。同时还介绍了PHP开发所需的PHP MySQL Apache集成环境,包括推荐的AppServ等版本。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • MySQL5.6.40在CentOS764下安装过程 ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • 本文介绍了在MacOS系统上安装MySQL的步骤,并详细说明了如何设置MySQL服务的开机启动和如何修改MySQL的密码。通过下载MySQL的macos版本并按照提示一步一步安装,在系统偏好设置中可以找到MySQL的图标进行设置。同时,还介绍了通过终端命令来修改MySQL的密码的具体操作步骤。 ... [详细]
  • centos安装Mysql的方法及步骤详解
    本文介绍了centos安装Mysql的两种方式:rpm方式和绿色方式安装,详细介绍了安装所需的软件包以及安装过程中的注意事项,包括检查是否安装成功的方法。通过本文,读者可以了解到在centos系统上如何正确安装Mysql。 ... [详细]
  • Centos下安装memcached+memcached教程
    本文介绍了在Centos下安装memcached和使用memcached的教程,详细解释了memcached的工作原理,包括缓存数据和对象、减少数据库读取次数、提高网站速度等。同时,还对memcached的快速和高效率进行了解释,与传统的文件型数据库相比,memcached作为一个内存型数据库,具有更高的读取速度。 ... [详细]
  • 腾讯安全平台部招聘安全工程师和数据分析工程师
    腾讯安全平台部正在招聘安全工程师和数据分析工程师。安全工程师负责安全问题和安全事件的跟踪和分析,提供安全测试技术支持;数据分析工程师负责安全产品相关系统数据统计和分析挖掘,通过用户行为数据建模为业务决策提供参考。招聘要求包括熟悉渗透测试和常见安全工具原理,精通Web漏洞,熟练使用多门编程语言等。有相关工作经验和在安全站点发表作品的候选人优先考虑。 ... [详细]
  • Python项目实战10.2:MySQL读写分离性能优化
    本文介绍了在Python项目实战中进行MySQL读写分离的性能优化,包括主从同步的配置和Django实现,以及在两台centos 7系统上安装和配置MySQL的步骤。同时还介绍了创建从数据库的用户和权限的方法。摘要长度为176字。 ... [详细]
  • mysql自动打开文件_让docker中的mysql启动时自动执行sql文件
    本文提要本文目的不仅仅是创建一个MySQL的镜像,而是在其基础上再实现启动过程中自动导入数据及数据库用户的权限设置,并且在新创建出来的容器里自动启动My ... [详细]
  • 基于PgpoolII的PostgreSQL集群安装与配置教程
    本文介绍了基于PgpoolII的PostgreSQL集群的安装与配置教程。Pgpool-II是一个位于PostgreSQL服务器和PostgreSQL数据库客户端之间的中间件,提供了连接池、复制、负载均衡、缓存、看门狗、限制链接等功能,可以用于搭建高可用的PostgreSQL集群。文章详细介绍了通过yum安装Pgpool-II的步骤,并提供了相关的官方参考地址。 ... [详细]
  • 本文介绍了如何在MySQL中将零值替换为先前的非零值的方法,包括使用内联查询和更新查询。同时还提供了选择正确值的方法。 ... [详细]
author-avatar
我是雅小贱-
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有