MySQL使用mysqld_multi部署单机多实例详细过程(二)

2015-11-21 01:57:04 · 作者: · 浏览: 26
ool_size = 128M

innodb_flush_log_at_trx_commit = 0

3.3 初始化数据库

?

/usr/local/mysql/scripts/mysql_install_db--user=mysql --basedir=/usr/local/mysql --datadir=/home/data/mysql3308/data

?

?

4,准备第三个实例3309

4.1 建立好目录

mkdir /usr/local/mysql3309

chown -R mysql.mysql /usr/local/mysql3309/

?

mkdir -p /home/data/mysql3309/data

chown -R mysql.mysql /home/data/mysql3309

chown -R mysql.mysql/home/data/mysql3309/data

?

mkdir -p /home/data/mysql3309/binlog

chown -R mysql.mysql /home/data/mysql3309

?

mkdir -p /home/data/mysql3309/relay_log/

chown -R mysql.mysql /home/data/mysql3309/

?

4.2 配置文件

[mysqld3]

socket = /usr/local/mysql3309/mysql.sock

port = 3309

pid-file = /usr/local/mysql3309/mysqld.pid

datadir = /home/data/mysql3309/data

?

log_bin=/home/data/mysql3309/binlog

server-id = 3230

relay_log = /home/data/mysql3309/relay_log/mysql-relay-bin

log_slave_updates = 1

read_only = 0

?

innodb_buffer_pool_size = 128M

innodb_flush_log_at_trx_commit = 0

4.3 初始化数据库

?

/usr/local/mysql/scripts/mysql_install_db--user=mysql --basedir=/usr/local/mysql --datadir=/home/data/mysql3309/data

初始化信息如下所示:

  [mysql@data02 ~]$ /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/home/data/mysql3309/data
WARNING: Could not write to config file /usr/local/mysql/my-new.cnf: 权限不够
 
Installing MySQL system tables...2015-05-14 09:31:20 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-05-14 09:31:20 12307 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
 
2015-05-14 09:31:20 12307 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)
 
2015-05-14 09:31:20 12307 [Note] InnoDB: The InnoDB memory heap is disabled
2015-05-14 09:31:20 12307 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-05-14 09:31:20 12307 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-05-14 09:31:20 12307 [Note] InnoDB: Using CPU crc32 instructions
2015-05-14 09:31:20 12307 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-05-14 09:31:20 12307 [Note] InnoDB: Completed initialization of buffer pool
2015-05-14 09:31:20 12307 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-05-14 09:31:20 12307 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-05-14 09:31:20 12307 [Note] InnoDB: Database physically writes the file full: wait...
2015-05-14 09:31:20 12307 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-05-14 09:31:20 12307 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-05-14 09:31:21 12307 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-05-14 09:31:21 12307 [Warning] InnoDB: New log files created, LSN=45781
2015-05-14 09:31:21 12307 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-05-14 09:31:21 12307 [Note] InnoDB: Doublewrite buffer created
2015-05-14 09:31:21 12307 [Note] InnoDB: 128 rollback segment(s) are active.
2015-05-14 09:31:21 12307 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-05-14 09:31:21 12307 [Note] InnoDB: Foreign key constraint system tables created
2015-05-1