You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

744 lines
18 KiB

  1. '\" t
  2. .\" Title: \fBmysqld_multi\fR
  3. .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
  5. .\" Date: 04/06/2010
  6. .\" Manual: MySQL Database System
  7. .\" Source: MySQL 5.1
  8. .\" Language: English
  9. .\"
  10. .TH "\FBMYSQLD_MULTI\FR" "1" "04/06/2010" "MySQL 5\&.1" "MySQL Database System"
  11. .\" -----------------------------------------------------------------
  12. .\" * set default formatting
  13. .\" -----------------------------------------------------------------
  14. .\" disable hyphenation
  15. .nh
  16. .\" disable justification (adjust text to left margin only)
  17. .ad l
  18. .\" -----------------------------------------------------------------
  19. .\" * MAIN CONTENT STARTS HERE *
  20. .\" -----------------------------------------------------------------
  21. .\" mysqld_multi
  22. .\" tools: mysqld_multi
  23. .\" scripts
  24. .\" multi mysqld
  25. .SH "NAME"
  26. mysqld_multi \- manage multiple MySQL servers
  27. .SH "SYNOPSIS"
  28. .HP \w'\fBmysqld_multi\ [\fR\fB\fIoptions\fR\fR\fB]\ {start|stop|report}\ [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB]\ \&.\&.\&.]\fR\ 'u
  29. \fBmysqld_multi [\fR\fB\fIoptions\fR\fR\fB] {start|stop|report} [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB] \&.\&.\&.]\fR
  30. .SH "DESCRIPTION"
  31. .PP
  32. \fBmysqld_multi\fR
  33. is designed to manage several
  34. \fBmysqld\fR
  35. processes that listen for connections on different Unix socket files and TCP/IP ports\&. It can start or stop servers, or report their current status\&. The MySQL Instance Manager is an alternative means of managing multiple servers (see
  36. \fBmysqlmanager\fR(8))\&.
  37. .PP
  38. \fBmysqld_multi\fR
  39. searches for groups named
  40. [mysqld\fIN\fR]
  41. in
  42. my\&.cnf
  43. (or in the file named by the
  44. \fB\-\-config\-file\fR
  45. option)\&.
  46. \fIN\fR
  47. can be any positive integer\&. This number is referred to in the following discussion as the option group number, or
  48. \fIGNR\fR\&. Group numbers distinguish option groups from one another and are used as arguments to
  49. \fBmysqld_multi\fR
  50. to specify which servers you want to start, stop, or obtain a status report for\&. Options listed in these groups are the same that you would use in the
  51. [mysqld]
  52. group used for starting
  53. \fBmysqld\fR\&. (See, for example,
  54. Section\ \&2.13.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see
  55. Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&.
  56. .PP
  57. To invoke
  58. \fBmysqld_multi\fR, use the following syntax:
  59. .sp
  60. .if n \{\
  61. .RS 4
  62. .\}
  63. .nf
  64. shell> \fBmysqld_multi [\fR\fB\fIoptions\fR\fR\fB] {start|stop|report} [\fR\fB\fIGNR\fR\fR\fB[,\fR\fB\fIGNR\fR\fR\fB] \&.\&.\&.]\fR
  65. .fi
  66. .if n \{\
  67. .RE
  68. .\}
  69. .PP
  70. start,
  71. stop, and
  72. report
  73. indicate which operation to perform\&. You can perform the designated operation for a single server or multiple servers, depending on the
  74. \fIGNR\fR
  75. list that follows the option name\&. If there is no list,
  76. \fBmysqld_multi\fR
  77. performs the operation for all servers in the option file\&.
  78. .PP
  79. Each
  80. \fIGNR\fR
  81. value represents an option group number or range of group numbers\&. The value should be the number at the end of the group name in the option file\&. For example, the
  82. \fIGNR\fR
  83. for a group named
  84. [mysqld17]
  85. is
  86. 17\&. To specify a range of numbers, separate the first and last numbers by a dash\&. The
  87. \fIGNR\fR
  88. value
  89. 10\-13
  90. represents groups
  91. [mysqld10]
  92. through
  93. [mysqld13]\&. Multiple groups or group ranges can be specified on the command line, separated by commas\&. There must be no whitespace characters (spaces or tabs) in the
  94. \fIGNR\fR
  95. list; anything after a whitespace character is ignored\&.
  96. .PP
  97. This command starts a single server using option group
  98. [mysqld17]:
  99. .sp
  100. .if n \{\
  101. .RS 4
  102. .\}
  103. .nf
  104. shell> \fBmysqld_multi start 17\fR
  105. .fi
  106. .if n \{\
  107. .RE
  108. .\}
  109. .PP
  110. This command stops several servers, using option groups
  111. [mysqld8]
  112. and
  113. [mysqld10]
  114. through
  115. [mysqld13]:
  116. .sp
  117. .if n \{\
  118. .RS 4
  119. .\}
  120. .nf
  121. shell> \fBmysqld_multi stop 8,10\-13\fR
  122. .fi
  123. .if n \{\
  124. .RE
  125. .\}
  126. .PP
  127. For an example of how you might set up an option file, use this command:
  128. .sp
  129. .if n \{\
  130. .RS 4
  131. .\}
  132. .nf
  133. shell> \fBmysqld_multi \-\-example\fR
  134. .fi
  135. .if n \{\
  136. .RE
  137. .\}
  138. .PP
  139. As of MySQL 5\&.1\&.18,
  140. \fBmysqld_multi\fR
  141. searches for option files as follows:
  142. .sp
  143. .RS 4
  144. .ie n \{\
  145. \h'-04'\(bu\h'+03'\c
  146. .\}
  147. .el \{\
  148. .sp -1
  149. .IP \(bu 2.3
  150. .\}
  151. .\" mysqld_multi: no-defaults option
  152. .\" no-defaults option: mysqld_multi
  153. With
  154. \fB\-\-no\-defaults\fR, no option files are read\&.
  155. .RE
  156. .sp
  157. .RS 4
  158. .ie n \{\
  159. \h'-04'\(bu\h'+03'\c
  160. .\}
  161. .el \{\
  162. .sp -1
  163. .IP \(bu 2.3
  164. .\}
  165. .\" mysqld_multi: defaults-file option
  166. .\" defaults-file option: mysqld_multi
  167. With
  168. \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR, only the named file is read\&.
  169. .RE
  170. .sp
  171. .RS 4
  172. .ie n \{\
  173. \h'-04'\(bu\h'+03'\c
  174. .\}
  175. .el \{\
  176. .sp -1
  177. .IP \(bu 2.3
  178. .\}
  179. .\" mysqld_multi: defaults-extra-file option
  180. .\" defaults-extra-file option: mysqld_multi
  181. Otherwise, option files in the standard list of locations are read, including any file named by the
  182. \fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
  183. option, if one is given\&. (If the option is given multiple times, the last value is used\&.)
  184. .RE
  185. .PP
  186. Before MySQL 5\&.1\&.18, the preceding options are not recognized\&. Files in the standard locations are read, and any file named by the
  187. \fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR
  188. option, if one is given\&. A file named by
  189. \fB\-\-config\-file\fR
  190. is read only for
  191. [mysqld\fIN\fR]
  192. option groups, not the
  193. [mysqld_multi]
  194. group\&.
  195. .PP
  196. Option files read are searched for
  197. [mysqld_multi]
  198. and
  199. [mysqld\fIN\fR]
  200. option groups\&. The
  201. [mysqld_multi]
  202. group can be used for options to
  203. \fBmysqld_multi\fR
  204. itself\&.
  205. [mysqld\fIN\fR]
  206. groups can be used for options passed to specific
  207. \fBmysqld\fR
  208. instances\&.
  209. .PP
  210. As of MySQL 5\&.1\&.35, the
  211. [mysqld]
  212. or
  213. [mysqld_safe]
  214. groups can be used for common options read by all instances of
  215. \fBmysqld\fR
  216. or
  217. \fBmysqld_safe\fR\&. You can specify a
  218. \fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
  219. option to use a different configuration file for that instance, in which case the
  220. [mysqld]
  221. or
  222. [mysqld_safe]
  223. groups from that file will be used for that instance\&. Before MySQL 5\&.1\&.35, some versions of
  224. \fBmysqld_multi\fR
  225. pass the
  226. \fB\-\-no\-defaults\fR
  227. options to instances, so these techniques are inapplicable\&.
  228. .PP
  229. \fBmysqld_multi\fR
  230. supports the following options\&.
  231. .sp
  232. .RS 4
  233. .ie n \{\
  234. \h'-04'\(bu\h'+03'\c
  235. .\}
  236. .el \{\
  237. .sp -1
  238. .IP \(bu 2.3
  239. .\}
  240. .\" mysqld_multi: help option
  241. .\" help option: mysqld_multi
  242. \fB\-\-help\fR
  243. .sp
  244. Display a help message and exit\&.
  245. .RE
  246. .sp
  247. .RS 4
  248. .ie n \{\
  249. \h'-04'\(bu\h'+03'\c
  250. .\}
  251. .el \{\
  252. .sp -1
  253. .IP \(bu 2.3
  254. .\}
  255. .\" mysqld_multi: config-file option
  256. .\" config-file option: mysqld_multi
  257. \fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR
  258. .sp
  259. As of MySQL 5\&.1\&.18, this option is deprecated\&. If given, it is treated the same way as
  260. \fB\-\-defaults\-extra\-file\fR, described earlier\&.
  261. \fB\-\-config\-file\fR
  262. is removed in MySQL 5\&.5\&.
  263. .sp
  264. Before MySQL 5\&.1\&.18, this option specifies the name of an extra option file\&. It affects where
  265. \fBmysqld_multi\fR
  266. looks for
  267. [mysqld\fIN\fR]
  268. option groups\&. Without this option, all options are read from the usual
  269. my\&.cnf
  270. file\&. The option does not affect where
  271. \fBmysqld_multi\fR
  272. reads its own options, which are always taken from the
  273. [mysqld_multi]
  274. group in the usual
  275. my\&.cnf
  276. file\&.
  277. .RE
  278. .sp
  279. .RS 4
  280. .ie n \{\
  281. \h'-04'\(bu\h'+03'\c
  282. .\}
  283. .el \{\
  284. .sp -1
  285. .IP \(bu 2.3
  286. .\}
  287. .\" mysqld_multi: example option
  288. .\" example option: mysqld_multi
  289. \fB\-\-example\fR
  290. .sp
  291. Display a sample option file\&.
  292. .RE
  293. .sp
  294. .RS 4
  295. .ie n \{\
  296. \h'-04'\(bu\h'+03'\c
  297. .\}
  298. .el \{\
  299. .sp -1
  300. .IP \(bu 2.3
  301. .\}
  302. .\" mysqld_multi: log option
  303. .\" log option: mysqld_multi
  304. \fB\-\-log=\fR\fB\fIfile_name\fR\fR
  305. .sp
  306. Specify the name of the log file\&. If the file exists, log output is appended to it\&.
  307. .RE
  308. .sp
  309. .RS 4
  310. .ie n \{\
  311. \h'-04'\(bu\h'+03'\c
  312. .\}
  313. .el \{\
  314. .sp -1
  315. .IP \(bu 2.3
  316. .\}
  317. .\" mysqld_multi: mysqladmin option
  318. .\" mysqladmin option: mysqld_multi
  319. \fB\-\-mysqladmin=\fR\fB\fIprog_name\fR\fR
  320. .sp
  321. The
  322. \fBmysqladmin\fR
  323. binary to be used to stop servers\&.
  324. .RE
  325. .sp
  326. .RS 4
  327. .ie n \{\
  328. \h'-04'\(bu\h'+03'\c
  329. .\}
  330. .el \{\
  331. .sp -1
  332. .IP \(bu 2.3
  333. .\}
  334. .\" mysqld_multi: mysqld option
  335. .\" mysqld option: mysqld_multi
  336. \fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
  337. .sp
  338. The
  339. \fBmysqld\fR
  340. binary to be used\&. Note that you can specify
  341. \fBmysqld_safe\fR
  342. as the value for this option also\&. If you use
  343. \fBmysqld_safe\fR
  344. to start the server, you can include the
  345. mysqld
  346. or
  347. ledir
  348. options in the corresponding
  349. [mysqld\fIN\fR]
  350. option group\&. These options indicate the name of the server that
  351. \fBmysqld_safe\fR
  352. should start and the path name of the directory where the server is located\&. (See the descriptions for these options in
  353. \fBmysqld_safe\fR(1)\&.) Example:
  354. .sp
  355. .if n \{\
  356. .RS 4
  357. .\}
  358. .nf
  359. [mysqld38]
  360. mysqld = mysqld\-debug
  361. ledir = /opt/local/mysql/libexec
  362. .fi
  363. .if n \{\
  364. .RE
  365. .\}
  366. .RE
  367. .sp
  368. .RS 4
  369. .ie n \{\
  370. \h'-04'\(bu\h'+03'\c
  371. .\}
  372. .el \{\
  373. .sp -1
  374. .IP \(bu 2.3
  375. .\}
  376. .\" mysqld_multi: no-log option
  377. .\" no-log option: mysqld_multi
  378. \fB\-\-no\-log\fR
  379. .sp
  380. Print log information to
  381. stdout
  382. rather than to the log file\&. By default, output goes to the log file\&.
  383. .RE
  384. .sp
  385. .RS 4
  386. .ie n \{\
  387. \h'-04'\(bu\h'+03'\c
  388. .\}
  389. .el \{\
  390. .sp -1
  391. .IP \(bu 2.3
  392. .\}
  393. .\" mysqld_multi: password option
  394. .\" password option: mysqld_multi
  395. \fB\-\-password=\fR\fB\fIpassword\fR\fR
  396. .sp
  397. The password of the MySQL account to use when invoking
  398. \fBmysqladmin\fR\&. Note that the password value is not optional for this option, unlike for other MySQL programs\&.
  399. .RE
  400. .sp
  401. .RS 4
  402. .ie n \{\
  403. \h'-04'\(bu\h'+03'\c
  404. .\}
  405. .el \{\
  406. .sp -1
  407. .IP \(bu 2.3
  408. .\}
  409. .\" mysqld_multi: silent option
  410. .\" silent option: mysqld_multi
  411. \fB\-\-silent\fR
  412. .sp
  413. Silent mode; disable warnings\&.
  414. .RE
  415. .sp
  416. .RS 4
  417. .ie n \{\
  418. \h'-04'\(bu\h'+03'\c
  419. .\}
  420. .el \{\
  421. .sp -1
  422. .IP \(bu 2.3
  423. .\}
  424. .\" mysqld_multi: tcp-ip option
  425. .\" tcp-ip option: mysqld_multi
  426. \fB\-\-tcp\-ip\fR
  427. .sp
  428. Connect to each MySQL server via the TCP/IP port instead of the Unix socket file\&. (If a socket file is missing, the server might still be running, but accessible only via the TCP/IP port\&.) By default, connections are made using the Unix socket file\&. This option affects
  429. stop
  430. and
  431. report
  432. operations\&.
  433. .RE
  434. .sp
  435. .RS 4
  436. .ie n \{\
  437. \h'-04'\(bu\h'+03'\c
  438. .\}
  439. .el \{\
  440. .sp -1
  441. .IP \(bu 2.3
  442. .\}
  443. .\" mysqld_multi: user option
  444. .\" user option: mysqld_multi
  445. \fB\-\-user=\fR\fB\fIuser_name\fR\fR
  446. .sp
  447. The user name of the MySQL account to use when invoking
  448. \fBmysqladmin\fR\&.
  449. .RE
  450. .sp
  451. .RS 4
  452. .ie n \{\
  453. \h'-04'\(bu\h'+03'\c
  454. .\}
  455. .el \{\
  456. .sp -1
  457. .IP \(bu 2.3
  458. .\}
  459. .\" mysqld_multi: verbose option
  460. .\" verbose option: mysqld_multi
  461. \fB\-\-verbose\fR
  462. .sp
  463. Be more verbose\&.
  464. .RE
  465. .sp
  466. .RS 4
  467. .ie n \{\
  468. \h'-04'\(bu\h'+03'\c
  469. .\}
  470. .el \{\
  471. .sp -1
  472. .IP \(bu 2.3
  473. .\}
  474. .\" mysqld_multi: version option
  475. .\" version option: mysqld_multi
  476. \fB\-\-version\fR
  477. .sp
  478. Display version information and exit\&.
  479. .RE
  480. .PP
  481. Some notes about
  482. \fBmysqld_multi\fR:
  483. .sp
  484. .RS 4
  485. .ie n \{\
  486. \h'-04'\(bu\h'+03'\c
  487. .\}
  488. .el \{\
  489. .sp -1
  490. .IP \(bu 2.3
  491. .\}
  492. \fBMost important\fR: Before using
  493. \fBmysqld_multi\fR
  494. be sure that you understand the meanings of the options that are passed to the
  495. \fBmysqld\fR
  496. servers and
  497. \fIwhy\fR
  498. you would want to have separate
  499. \fBmysqld\fR
  500. processes\&. Beware of the dangers of using multiple
  501. \fBmysqld\fR
  502. servers with the same data directory\&. Use separate data directories, unless you
  503. \fIknow\fR
  504. what you are doing\&. Starting multiple servers with the same data directory does
  505. \fInot\fR
  506. give you extra performance in a threaded system\&. See
  507. Section\ \&5.6, \(lqRunning Multiple MySQL Servers on the Same Machine\(rq\&.
  508. .RE
  509. .sp
  510. .RS 4
  511. .ie n \{\
  512. \h'-04'\(bu\h'+03'\c
  513. .\}
  514. .el \{\
  515. .sp -1
  516. .IP \(bu 2.3
  517. .\}
  518. .if n \{\
  519. .sp
  520. .\}
  521. .RS 4
  522. .it 1 an-trap
  523. .nr an-no-space-flag 1
  524. .nr an-break-flag 1
  525. .br
  526. .ps +1
  527. \fBImportant\fR
  528. .ps -1
  529. .br
  530. Make sure that the data directory for each server is fully accessible to the Unix account that the specific
  531. \fBmysqld\fR
  532. process is started as\&.
  533. \fIDo not\fR
  534. use the Unix
  535. \fIroot\fR
  536. account for this, unless you
  537. \fIknow\fR
  538. what you are doing\&. See
  539. Section\ \&5.3.6, \(lqHow to Run MySQL as a Normal User\(rq\&.
  540. .sp .5v
  541. .RE
  542. .RE
  543. .sp
  544. .RS 4
  545. .ie n \{\
  546. \h'-04'\(bu\h'+03'\c
  547. .\}
  548. .el \{\
  549. .sp -1
  550. .IP \(bu 2.3
  551. .\}
  552. Make sure that the MySQL account used for stopping the
  553. \fBmysqld\fR
  554. servers (with the
  555. \fBmysqladmin\fR
  556. program) has the same user name and password for each server\&. Also, make sure that the account has the
  557. SHUTDOWN
  558. privilege\&. If the servers that you want to manage have different user names or passwords for the administrative accounts, you might want to create an account on each server that has the same user name and password\&. For example, you might set up a common
  559. multi_admin
  560. account by executing the following commands for each server:
  561. .sp
  562. .if n \{\
  563. .RS 4
  564. .\}
  565. .nf
  566. shell> \fBmysql \-u root \-S /tmp/mysql\&.sock \-p\fR
  567. Enter password:
  568. mysql> \fBGRANT SHUTDOWN ON *\&.*\fR
  569. \-> \fBTO \'multi_admin\'@\'localhost\' IDENTIFIED BY \'multipass\';\fR
  570. .fi
  571. .if n \{\
  572. .RE
  573. .\}
  574. .sp
  575. See
  576. Section\ \&5.4, \(lqThe MySQL Access Privilege System\(rq\&. You have to do this for each
  577. \fBmysqld\fR
  578. server\&. Change the connection parameters appropriately when connecting to each one\&. Note that the host name part of the account name must allow you to connect as
  579. multi_admin
  580. from the host where you want to run
  581. \fBmysqld_multi\fR\&.
  582. .RE
  583. .sp
  584. .RS 4
  585. .ie n \{\
  586. \h'-04'\(bu\h'+03'\c
  587. .\}
  588. .el \{\
  589. .sp -1
  590. .IP \(bu 2.3
  591. .\}
  592. The Unix socket file and the TCP/IP port number must be different for every
  593. \fBmysqld\fR\&. (Alternatively, if the host has multiple network addresses, you can use
  594. \fB\-\-bind\-address\fR
  595. to cause different servers to listen to different interfaces\&.)
  596. .RE
  597. .sp
  598. .RS 4
  599. .ie n \{\
  600. \h'-04'\(bu\h'+03'\c
  601. .\}
  602. .el \{\
  603. .sp -1
  604. .IP \(bu 2.3
  605. .\}
  606. The
  607. \fB\-\-pid\-file\fR
  608. option is very important if you are using
  609. \fBmysqld_safe\fR
  610. to start
  611. \fBmysqld\fR
  612. (for example,
  613. \fB\-\-mysqld=mysqld_safe\fR) Every
  614. \fBmysqld\fR
  615. should have its own process ID file\&. The advantage of using
  616. \fBmysqld_safe\fR
  617. instead of
  618. \fBmysqld\fR
  619. is that
  620. \fBmysqld_safe\fR
  621. monitors its
  622. \fBmysqld\fR
  623. process and restarts it if the process terminates due to a signal sent using
  624. kill \-9
  625. or for other reasons, such as a segmentation fault\&. Please note that the
  626. \fBmysqld_safe\fR
  627. script might require that you start it from a certain place\&. This means that you might have to change location to a certain directory before running
  628. \fBmysqld_multi\fR\&. If you have problems starting, please see the
  629. \fBmysqld_safe\fR
  630. script\&. Check especially the lines:
  631. .sp
  632. .if n \{\
  633. .RS 4
  634. .\}
  635. .nf
  636. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  637. MY_PWD=`pwd`
  638. # Check if we are starting this relative (for the binary release)
  639. if test \-d $MY_PWD/data/mysql \-a \e
  640. \-f \&./share/mysql/english/errmsg\&.sys \-a \e
  641. \-x \&./bin/mysqld
  642. \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
  643. .fi
  644. .if n \{\
  645. .RE
  646. .\}
  647. .sp
  648. The test performed by these lines should be successful, or you might encounter problems\&. See
  649. \fBmysqld_safe\fR(1)\&.
  650. .RE
  651. .sp
  652. .RS 4
  653. .ie n \{\
  654. \h'-04'\(bu\h'+03'\c
  655. .\}
  656. .el \{\
  657. .sp -1
  658. .IP \(bu 2.3
  659. .\}
  660. You might want to use the
  661. \fB\-\-user\fR
  662. option for
  663. \fBmysqld\fR, but to do this you need to run the
  664. \fBmysqld_multi\fR
  665. script as the Unix
  666. root
  667. user\&. Having the option in the option file doesn\'t matter; you just get a warning if you are not the superuser and the
  668. \fBmysqld\fR
  669. processes are started under your own Unix account\&.
  670. .RE
  671. .PP
  672. The following example shows how you might set up an option file for use with
  673. \fBmysqld_multi\fR\&. The order in which the
  674. \fBmysqld\fR
  675. programs are started or stopped depends on the order in which they appear in the option file\&. Group numbers need not form an unbroken sequence\&. The first and fifth
  676. [mysqld\fIN\fR]
  677. groups were intentionally omitted from the example to illustrate that you can have
  678. \(lqgaps\(rq
  679. in the option file\&. This gives you more flexibility\&.
  680. .sp
  681. .if n \{\
  682. .RS 4
  683. .\}
  684. .nf
  685. # This file should probably be in your home dir (~/\&.my\&.cnf)
  686. # or /etc/my\&.cnf
  687. # Version 2\&.1 by Jani Tolonen
  688. [mysqld_multi]
  689. mysqld = /usr/local/bin/mysqld_safe
  690. mysqladmin = /usr/local/bin/mysqladmin
  691. user = multi_admin
  692. password = multipass
  693. [mysqld2]
  694. socket = /tmp/mysql\&.sock2
  695. port = 3307
  696. pid\-file = /usr/local/mysql/var2/hostname\&.pid2
  697. datadir = /usr/local/mysql/var2
  698. language = /usr/local/share/mysql/english
  699. user = john
  700. [mysqld3]
  701. socket = /tmp/mysql\&.sock3
  702. port = 3308
  703. pid\-file = /usr/local/mysql/var3/hostname\&.pid3
  704. datadir = /usr/local/mysql/var3
  705. language = /usr/local/share/mysql/swedish
  706. user = monty
  707. [mysqld4]
  708. socket = /tmp/mysql\&.sock4
  709. port = 3309
  710. pid\-file = /usr/local/mysql/var4/hostname\&.pid4
  711. datadir = /usr/local/mysql/var4
  712. language = /usr/local/share/mysql/estonia
  713. user = tonu
  714. [mysqld6]
  715. socket = /tmp/mysql\&.sock6
  716. port = 3311
  717. pid\-file = /usr/local/mysql/var6/hostname\&.pid6
  718. datadir = /usr/local/mysql/var6
  719. language = /usr/local/share/mysql/japanese
  720. user = jani
  721. .fi
  722. .if n \{\
  723. .RE
  724. .\}
  725. .PP
  726. See
  727. Section\ \&4.2.3.3, \(lqUsing Option Files\(rq\&.
  728. .SH "COPYRIGHT"
  729. .br
  730. .PP
  731. Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
  732. .PP
  733. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
  734. .PP
  735. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  736. .PP
  737. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
  738. .sp
  739. .SH "SEE ALSO"
  740. For more information, please refer to the MySQL Reference Manual,
  741. which may already be installed locally and which is also available
  742. online at http://dev.mysql.com/doc/.
  743. .SH AUTHOR
  744. Sun Microsystems, Inc. (http://www.mysql.com/).