我要评分
获取效率
正确性
完整性
易理解

Initializing the MySQL Database

Initialize the MySQL database. For details, see the MySQL Installation Guide.

To verify the MyCAT database sharding function, database tables are distributed to three databases based on the sharding rule. Therefore, you need to initialize three databases in the same environment. The parameter settings are as follows.

Table 1 Database initialization parameters

Parameter

Description

Database dn1

Database dn2

Database dn3

port

Port

3309

3310

3311

datadir

Data path

/data/mysql/data1

/data/mysql/data2

/data/mysql/data3

log-error

Log path

/data/mysql/log/mysql1.log

/data/mysql/log/mysql2.log

/data/mysql/log/mysql3.log

pid-file

PID file path

/data/mysql/run/mysqld1.pid

/data/mysql/run/mysqld2.pid

/data/mysql/run/mysqld3.pid

socket

Socket path

/data/mysql/run/mysql1.sock

/data/mysql/run/mysql2.sock

/data/mysql/run/mysql3.sock