我的博客已迁移到xdoujiang.com请去那边和我交流
前言:领导要求在1台DELL R710上安装多个mysql实例
一、安装第1个实例
1、当前系统
cat /etc/debian_version
6.0.10
2、查看安装包
apt-cache search mysql-server|grep "mysql-server"
mysql-server-5.1 - MySQL database server binaries and system database setup
mysql-server-core-5.1 - MySQL database server binaries
mysql-server - MySQL database server (metapackage depending on the latest version)
3、安装mysql(会安装mysql相关的一系列的包)
apt-get -y install mysql-server --force-yes
二、安装第二个实例
1、创建目录(我这边将第二个实例安装在/opt下)
cd /opt/
mkdir mysql3307
2、复制mysql表和配置文件
cd /var/lib/mysql/
cp -a mysql /opt/mysql3307/
cp /etc/mysql/my.cnf /opt/mysql3307/
3、修改配置(一般就是改下port和sock和pid和datadir路径)
port            = 3307
socket          = /var/run/mysqld/mysqld3307.sock
pid-file        = /var/run/mysqld/mysqld3307.pid
datadir         = /opt/mysql3307
4、给mysql权限
chown -R mysql.root /opt/mysql3307/
5、启mysql(这里使用mysql用户启)
修改/etc/passed文件
mysql:x:102:104:MySQL Server,,,:/var/lib/mysql:/bin/bash
su - mysql
/usr/sbin/mysqld --defaults-file=/opt/mysql3307/my.cnf --basedir=/usr --datadir=/opt/mysql3307/ --user=mysql --pid-file=/var/run/mysqld/mysqld3307.pid --skip-external-locking --port=3307 --socket=/var/run/mysqld/mysqld3307.sock &
[1] 2484
150505  9:30:06 [Note] Plugin 'FEDERATED' is disabled.
150505  9:30:07  InnoDB: Initializing buffer pool, size = 8.0M
150505  9:30:07  InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150505  9:30:07  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150505  9:30:07  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
150505  9:30:07  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150505  9:30:07  InnoDB: Started; log sequence number 0 0
150505  9:30:07 [Note] Event Scheduler: Loaded 0 events
150505  9:30:07 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.73-1'  socket: '/var/run/mysqld/mysqld3307.sock'  port: 3307  (Debian)
6、最后查看2个mysql实例是否正常运行着
ps aux|grep mysql
root      2152  0.0  0.0   3956   616 ?        S    08:53   0:00 /bin/sh /usr/bin/mysqld_safe
mysql     2276  0.0  3.6 182456 37560 ?        Sl   08:53   0:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
root      2277  0.0  0.0   5348   688 ?        S    08:53   0:00 logger -t mysqld -p daemon.error
mysql     2480  0.0  0.1  36884  1232 pts/0    S    09:29   0:00 su - mysql
mysql     2481  0.0  0.1  19220  1976 pts/0    S    09:29   0:00 -su
mysql     2484  5.5  3.6 174064 37004 pts/0    Sl   09:30   0:00 /usr/sbin/mysqld --defaults-file=/opt/mysql3307/my.cnf --basedir=/usr --datadir=/opt/mysql3307/ --user=mysql --pid-file=/var/run/mysqld/mysqld3307.pid --skip-external-locking --port=3307 --socket=/var/run/mysqld/mysqld3307.sock
mysql     2495  0.0  0.1  16340  1136 pts/0    R+   09:30   0:00 ps aux
mysql     2496  0.0  0.0   7548   820 pts/0    S+   09:30   0:00 grep mysql
7、登陆2个mysql实例看下
mysql -uroot -predhat -S /var/run/mysqld/mysqld.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 54
Server version: 5.1.73-1 (Debian)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
mysql -uroot -predhat -S /var/run/mysqld/mysqld3307.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73-1 (Debian)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
mysql@10:~$
三、引擎
当前版本引擎
mysql -uroot -predhat -S /var/run/mysqld/mysqld.sock -e "show engines;"
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
配置修改默认引擎为innodb
是在[mysqld]这个里面
default_table_type = innodb
5.5的话默认引擎直接是innodb了 不需要修改

转载于:https://blog.51cto.com/7938217/1650434

安装多个mysql实例(debian版本)相关推荐

  1. debian安装什么mysql_安装多个mysql实例(debian版本)

    安装多个mysql实例(debian版本) 我的博客已迁移到xdoujiang.com请去那边和我交流 前言:领导要求在1台DELL R710上安装多个mysql实例 一.安装第1个实例 1.当前系统 ...

  2. 一台服务器可以安装多个mysql数据库_在一台Linux服务器上安装多个MySQL实例(一)--使用mysqld_multi方式...

    (一)MySQL多实例概述 实例是进程与内存的一个概述,所谓MySQL多实例,就是在服务器上启动多个相同的MySQL进程,运行在不同的端口(如3306,3307,3308),通过不同的端口对外提供服务 ...

  3. win2003能装mysql_win2003 安装2个mysql实例做主从同步服务配置

    win2003 安装2个mysql实例做主从同步服务配置 2017年12月12日 | 萬仟网IT编程 | 我要评论 配置前的准备: 2台电脑,均安装windows2003 64位.均分三区c,d,e. ...

  4. 阿里云 mysql升级_如何升级阿里云MySQL实例的版本?

    从MySQL 5.5升级至MySQL 5.6 RDS控制台提供了MySQL 5.5到MySQL 5.6一键升级的功能,详细步骤请参见升级数据库版本. •从MySQL 5.6高可用版升级至MySQL 5 ...

  5. Linux环境——MySQL安装及配置(8.0版本)

    虚拟机环境是Linux  Red Hat Enterprlse Linux (64位),本次安装的是Mysql 8.0版本. 由于有经验了,所以又弄了台虚拟机练手,承接上一篇博客(https://ww ...

  6. 征途linux mysql_Linux环境——MySQL安装及配置(5.7版本)

    选择适合自己的版本,我的环境是Linux  Red Hat Enterprlse Linux (64位),本次安装的是Mysql 5.7版本. 说一下安装中经历的坎坷,开始虚拟机中有默认版本5.1,版 ...

  7. Linux环境——MySQL安装及配置(5.7版本)

    数据库安装包下载地址:https://dev.mysql.com/downloads/mysql/ 选择适合自己的版本,我的环境是Linux  Red Hat Enterprlse Linux (64 ...

  8. mysql多实例安装配置_MySQL多实例安装配置

    MySQL进行多实例配置再生产环境中非常常见,比如一些高配置数据库服务器,就会跑多个MySQL实例,借助多实例绑定的方式提高服务器的整体资源利用率.另外在MySQL5.7以上版本还不支持多源复制时,当 ...

  9. redis mysql 案例_linux安装redis和mysql的实例讲解

    linux环境下安装redis和mysql 安装redis(版本3.2.10): 下载地址:https://redis.io/download,这里我下载3.2.10 // 解压 tar zxvf r ...

  10. centos 多个mysql,Centos中安装多个MySQL数据的配置实例

    这篇文章主要为大家详细介绍了Centos中安装多个MySQL数据的配置实例,具有一定的参考价值,可以用来参考一下. 感兴趣的小伙伴,下面一起跟随512笔记的小编小韵来看看吧! 注:本文档做了两个MYS ...

最新文章

  1. Go 学习笔记(8)— 条件语句(if、if...else...、switch、fallthrough)
  2. 登上Science子刊,神经科学再次启发DNN设计!中科院揭秘介观自组织反向传播机制...
  3. 关于win2003服务器远程断开后自动注销的问题解决
  4. 腾讯云工业互联网助力平台发布 推动制造业“数字化”蝶变
  5. 从封装函数到实现简易版自用jQuery (一)
  6. 从Linux系统内存逐步认识Android应用内存
  7. SharePoint 2013 图文开发系列之WebPart
  8. wxWidgets:wxStaticText类用法
  9. Java不兼容类型问题解决方案
  10. 如何使用struts2对集合参数进行验证
  11. C++面试宝典 基本语言(三)
  12. 用感知器对样本分类的matlab程序_新的基础算法:树突网络:一个用于分类、回归和系统识别的白箱模块...
  13. Java, 基础(面试题)总结(分享-交流)
  14. linux 查看隐藏文件大小,Linux运维知识之linux下显示隐藏目录或隐藏文件占用空间大小...
  15. 计算机毕业设计jsp宠物美容网站
  16. 大家好,欢迎您加入这个集体!
  17. 统计案例 | 系列文章合集
  18. 盘一盘 Python 系列 - Cufflinks (下)
  19. 天梯赛训练 电话聊天狂人(25 分)
  20. 神经网络算法有哪些模型,神经网络的简单模型是

热门文章

  1. Regex Tester 安装教程
  2. .net页面间的参数传递简单实例
  3. 用virtualenv建立独立虚拟环境 批量导入模块信息
  4. linux中安装typecho的pathinfo配置
  5. CentosOS 7: 创建Nginx+Https网站
  6. EasyUI常用控件禁用方法
  7. 浅谈移动前端的最佳实践
  8. FlashDevelop4 快捷键
  9. js开源框架最新版下载
  10. BZOJ1861:[ZJOI2006]书架——题解