mysql-5.1.73多实例安装启动
一、源码包下载:http://download.softagency.net/MySQL/Downloads/MySQL-5.1/
二、编译安装
groupadd mysql
useradd -r -g mysql mysql
mkdir /data/mysql_multi/mysql_exa1/
cd /data/mysql_multi/mysql_exa1/
mkdir data binlog log mkdir /data/mysql_multi/mysql_exa2/
cd /data/mysql_multi/mysql_exa2/
mkdir data binlog log chown -R mysql:mysql /data/mysql_multi/mysql_exa2/ /data/mysql_multi/mysql_exa1/ cd /data/installs/mysql-5.1.
./configure --prefix=/usr/local/mysql5. --with-plugins=innobase,innodb_plugin,myisam #编译参数参考:http://dev.mysql.com/doc/refman/5.1/en/source-configuration-options.html
make
make install cd /usr/local/mysql5./bin/
./mysql_install_db --user=mysql --basedir=/usr/local/mysql5. --datadir=/data/mysql_multi/mysql_exa1/data/
./mysql_install_db --user=mysql --basedir=/usr/local/mysql5. --datadir=/data/mysql_multi/mysql_exa2/data/ cp -rp ../share/mysql/mysqld_multi.server /etc/init.d/mysql_multi #复制启动文件
vim /etc/init.d/mysql_multi #修改basedir 和 datadir
三、配置多实例
[mysqld_multi]
mysqld = /usr/local/mysql5.1/bin/mysqld_safe
mysqladmin = /usr/local/mysql5.1/bin/mysqladmin
user = root #管理实例时指定的用户名和密码
password = 1234 [client]
#port = 3306
#socket = /data/mysql_multi/mysql_exa1/mysql.sock [mysqld3307]
server-id = 3307
port = 3307 socket = /data/mysql_multi/mysql_exa1/mysql.sock
pid-file = /data/mysql_multi/mysql_exa1/mysql.pid
datadir = /data/mysql_multi/mysql_exa1/data
log-error = /data/mysql_multi/mysql_exa1/log/error.log long_query_time = 1
slow_query_log_file = /data/mysql_multi/mysql_exa1/log/slow-query.log log-bin = /data/mysql_multi/mysql_exa1/binlog/mysql-bin
log-bin-index = /data/mysql_multi/mysql_exa1/binlog/mysql-bin.index
expire_logs_days = 2
binlog_format=mixed skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 2M
#Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 80M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_file_io_threads = 4
[mysqld3308]
server-id = 3308
port = 3308 socket = /data/mysql_multi/mysql_exa2/mysql.sock
pid-file = /data/mysql_multi/mysql_exa2/mysql.pid
datadir = /data/mysql_multi/mysql_exa2/data
log-error = /data/mysql_multi/mysql_exa2/log/error.log long_query_time = 1
slow_query_log_file = /data/mysql_multi/mysql_exa2/log/slow-query.log log-bin = /data/mysql_multi/mysql_exa2/binlog/mysql-bin
log-bin-index = /data/mysql_multi/mysql_exa2/binlog/mysql-bin.index
expire_logs_days = 2
binlog_format=mixed skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 2M
#Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 80M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT
innodb_file_io_threads = 4
[mysqldump]
quick
max_allowed_packet = 16M [mysql]
no-auto-rehash [myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M [mysqlhotcopy]
interactive-timeout
四、启动多实例
root@192.168.100.246:/usr/local/mysql5./bin# /etc/init.d/mysqld_multi start
root@192.168.100.246:/usr/local/mysql5./bin# /etc/init.d/mysqld_multi start
root@192.168.100.246:/usr/local/mysql5./bin# netstat -lntp | grep mysql
tcp 0.0.0.0: 0.0.0.0:* LISTEN /mysqld
tcp 0.0.0.0: 0.0.0.0:* LISTEN /mysqld
tcp 0.0.0.0: 0.0.0.0:* LISTEN /mysqld
五、关闭多实例
5.1 分别设置密码
root@192.168.100.246:/usr/local/mysql5./bin# mysql -uroot -p -S /data/mysql_multi/mysql_exa1/mysql.sock #指定sock文件路径登录
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.1.-log Source distribution Copyright (c) , , Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set password=password('');
Query OK, rows affected (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec) root@192.168.100.246:/usr/local/mysql5./bin# mysql -uroot -p -S /data/mysql_multi/mysql_exa2/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.1.-log Source distribution Copyright (c) , , Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set password=password('');
Query OK, rows affected (0.00 sec) mysql> flush privileges;
Query OK, rows affected (0.00 sec)
5.2 关闭实例
root@192.168.100.246:/usr/local/mysql5./bin# /etc/init.d/mysqld_multi stop
root@192.168.100.246:/usr/local/mysql5./bin# /etc/init.d/mysqld_multi stop
root@192.168.100.246:/usr/local/mysql5./bin# netstat -lntp | grep mysql
tcp 0.0.0.0: 0.0.0.0:* LISTEN /mysqld
六、注意事项
a. mysql_multi.log默认路径:/usr/local/mysql5.1/share/mysqld_multi.log
b. 新加实例时,只需要在配置文件加上实例相关配置,启动实例即可,停止实例也类似
c. 多实例mysql数据库在本机登录必须指定socket登录,而在其他机器上,可以通过指定port登录
mysql-5.1.73多实例安装启动的更多相关文章
- MySQL多版本多实例安装启动
多版本,大版本不同测试多实例,一个MySQL5.7.30一个MySQL8.0.20 解压8.0 tar -xvf mysql-8.0.20-linux-glibc2.12-x86_64.tar tar ...
- elasticsearch 单实例安装启动
elasticsearch 初次启动 下载 elasticsearch-6.3.2.tar.gz 创建目录 /usr/local/elasticsearch/ 解压 tar -zxf elastics ...
- Mysql多实例 安装以及配置
MySQL多实例 1.什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的soc ...
- Mysql 之多实例 安装以及配置
MySQL多实例 1.什么是MySQL多实例 简单地说,Mysql多实例就是在一台服务器上同时开启多个不同的服务端口(3306.3307),同时运行多个Mysql服务进程,这些服务进程通过不同的soc ...
- windows下mysql多实例安装
在学习和开发过程中有时候会用到多个MySQL数据库,比如Master-Slave集群.分库分表,开发阶段在一台机器上安装多个MySQL实例就显得方便不少. 在 MySQL教程-基础篇-1.1-Wind ...
- MySQL多实例安装
1.安装MySQL需要的依赖的包和编译软件 (1)安装MySQL需要的依赖包 安装MySQL之前,最好先安装MySQL需要的依赖包,不然后面会出现报错,还得回来安装MySQL的依赖包. [root ...
- Windows下MySQL多实例安装/主从复制/重置密码
Windows创建MySQL多实例 安装MYSQL和实例1 运行mysql-installer-community-5.7.16.0.msi 选择组件 MySQL Server 5.7.16 – X6 ...
- MySQL 单实例编译安装 以及多实例安装简介
这是基本的安装教程,与牛逼的大神无关,或许是牛逼大神不用看就会安装吧. CentOS 6.5 Final x86_64 一.预安装软件包 1.开发包组合安装 yum groupinstall &qu ...
- linux 下mysql多实例安装
1.软件下载 https://dev.mysql.com/downloads/file/?id=479096 免编译二进制包 mysql-5.6.21-linux-glibc2.5-x86_64.ta ...
随机推荐
- Bluetooth篇 开发实例之十 官网的Bluetooth Chat sample app.
运行的时候,会报错: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.Action ...
- Ubuntu 16.04没有/etc/default/rcS文件的UTC设置选项的问题解决
继续上一篇文章介绍了CentOS的时钟设置:http://www.cnblogs.com/EasonJim/p/8111747.html,大致的知道了BIOS在Linux的时区设置. 而现在关心的问题 ...
- Ubuntu 16.04网络管理工具NetworkManager无法使用nm-tool的问题
说明: 1.在Ubuntu中网络设置分两类,一个是GUI配置工具NetworkManager,另一个是命令行的配置,两者只能共存一个,也就是说其中一个设置之后另一个就会失效: 2.NetworkMan ...
- 用字符串连接SQL语句并用EXEC执行时,出现名称 '‘不是有效的标识符
原文:用字符串连接SQL语句并用EXEC执行时,出现名称 ''不是有效的标识符 用字符串连接SQL语句并用EXEC执行时,出现名称 '这里是字符串连接的一条SQL语句‘不是有效的标识符 才发现,在写e ...
- 前后台JSON传值得一个问题和异常处理net.sf.json.JSONException: Unquotted string '"name"'
项目中做导入的时候遇到个bug,用JSON.stringify()序列号json对象传给后台:然后后台通过getPatameter()获取值时,前台的英文引号变成了中文引号. 原来代码如下:(自己排查 ...
- MIT算法导论笔记
详细MIT算法导论笔记 (网络链接) 第一讲:课程简介及算法分析 (Sheridan) 第二讲:渐近符号.递归及解法 (Sheridan) 第三讲:分治法(1)(Sheridan) 第四讲:快排及随 ...
- HTML5游戏实战(1):50行代码实现正面跑酷游戏
前段时间看到一个"熊来了"的HTML5跑酷游戏,它是一个典型的正面2D跑酷游戏,这里借用它来介绍一下用Gamebuilder+CanTK开发正面跑酷游戏的基本方法. CanTK(C ...
- How to Clear setInterval() without Knowing the ID
ProblemDeclaring a setInterval() without keeping a reference to it (which is returned from the funct ...
- AndroidStudio怎么实现微信分享功能
在应用中添加微信分享功能,需要在微信开放平台上传你的应用,审核通过后方可使用此功能. https://open.weixin.qq.com/网址 申请的过程比较简单,这里就不追溯了,贴一个友情链接 h ...
- 模式识别:利用MATLAB生成模式类
近期開始了模式识别的学习,在此之前须要对模式和模式类的概念有一个了解,这里使用MATLAB实现一些模式类的生成.在此之前,引用百科上对于模式识别和模式类的定义.也算加深以下了解: 模式识别(Patte ...