博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux mysql 实例_linux下安装第二个mysql实例过程
阅读量:4318 次
发布时间:2019-06-06

本文共 1788 字,大约阅读时间需要 5 分钟。

tar zxvf mysql-5.5.3-m3.tar.gz cd mysql-5.5.3-m3/ ./configure --prefix=/usr/local/mysql2/ --with-tcp-port=3307 --with-unix-socket-path=/tmp/mysql2.sock --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big

tar zxvf mysql-5.5.3-m3.tar.gz

cd mysql-5.5.3-m3/

./configure --prefix=/usr/local/mysql2/ --with-tcp-port=3307 --with-unix-socket-path=/tmp/mysql2.sock --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg

make && make install

cp /usr/local/mysql2/share/mysql/my-medium.cnf /etc/my2.cnf

cp /usr/local/mysql2/share/mysql/mysql.server /etc/init.d/mysql2

修改服务文件

vi /etc/rc.d/init.d/mysql2

将引用的配置文件名称由my.cnf改为当前要使用的配置文件my2.cnf,将my.cnf改成my2.cnf

# Try to find basedir in /etc/my.cnf

conf=/etc/my.cnf

print_defaults=

if test -r $conf

then

在$bindir/mysqld_safe中添加--defaults-file=/etc/my2.cnf

修改成下面

# may be overwritten at next upgrade.

$bindir/mysqld_safe --defaults-file=/etc/my2.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &

保存。

初始化数据库

/usr/local/mysql2/bin/mysql_install_db --defaults-file=/etc/my2.cnf --basedir=/usr/local/mysql2/ --datadir=/usr/local/mysql2/var/ --user=mysql

chown -R mysql /usr/local/mysql2/var

chgrp -R mysql /usr/local/mysql2/.

chmod 755 /etc/init.d/mysql2

chkconfig --level 345 mysql2 on

service mysql2 start

至此安装完毕,可以启动一下,看是否有该进程

netstat -tlnap | grep mysql

/usr/local/mysql2/bin/mysql -uroot -p --socket=/tmp/mysql2.sock

change master to master_host='0.0.0.0', master_user='replication',master_password='00000', master_log_file='mysql-bin.000005', master_log_pos=107,MASTER_PORT=3306;

要指定端口,要不用的是本实例默认端口。

Tags - mysql , mysql安装

转载地址:http://errzs.baihongyu.com/

你可能感兴趣的文章
关于kindedit和 Uedit后者兼容前者
查看>>
微软BI 之SSIS 系列 - 利用 SSIS 模板快速开发 SSIS Package
查看>>
eclipse中使用git上传到githup,报401 Authorization Required
查看>>
基于Golang打造一款开源的WAF网关
查看>>
POJ 2955 Brackets
查看>>
Python: execute an external program (zz)
查看>>
在T-SQL语句中访问远程数据库(openrowset/opendatasource/openquery)
查看>>
Ubuntu14.04安装JDK
查看>>
Latex 公式换行问题(换行,等号对齐)
查看>>
php mysqli解决乱码
查看>>
VC Q&A (原创)
查看>>
linux命令
查看>>
多线程(一)NSThread
查看>>
POJ 2584 T-Shirt Gumbo
查看>>
闭包2
查看>>
轮播图组件及vue-awesome-swiper的引入
查看>>
Java 笔记07
查看>>
POJ 3041 Asteroids (二分匹配)
查看>>
响应式布局
查看>>
缺陷跟踪系统Mantis之安装篇(转载)
查看>>