MySQL 5.7 multi-instance installation best practices

MySQL 5.7 multi-instance installation best practices, connected to a " MySQL 5.7 installation best practices " to add a new instance of the existing examples above, mainly to rational use of resources; Here are the steps:

1, planning a new instance of the directory, the my.cnf configuration file
[the root @ localhost ~] # mkdir -p / Data / MySQL / mysql3307 / {Data, tmp, logs}
[the root @ localhost ~] # chown -R & lt MySQL: MySQL / Data / MySQL / mysql3307
[the root @ localhost ~] # CP /etc/my.cnf /etc/my3307.cnf
[the root @ localhost ~] # Vim /etc/my3307.cnf
:% S / 3306/3307 / G - ----- # replace 3006 to 3307
: WQ ------- save and exit #

2, a new instance of the initial installation, error log viewer
[the root @ localhost ~] # / usr / local / MySQL / bin / mysqld = --defaults-File / etc / my3307.cnf --initialize
[the root @ localhost ~] More # /data/mysql/mysql3307/data/error.log
no error to indicate initialization is complete.

3, a new instance is started, error log to see
[the root @ localhost ~] # / usr / local / MySQL / bin / mysqld = --defaults-File / etc / & my3307.cnf
[the root @ localhost ~] More # / Data / mysql / mysql3307 / data / error.log
no error it means to start is complete.

4, a new instance root password changes, configure a remote connection permissions
[root @ localhost ~] # More /data/mysql/mysql3307/data/error.log | grep password
2018-12-28T15: 59: 10.065970 + 08: 00 1 [ note] a temporary password is generated for root @ localhost: yK> 1MkFsrr8N
temporary password for the user's root: yK> 1MkFsrr8N
[root @ localhost ~] # -p MySQL -S /tmp/mysql3307.sock
the enter password: [input here above temporary password]
SET Global super_read_only = 0; SET Global READ_ONLY = 0;
(Unknown) @localhost [(none)]> ALTER user user () IDENTIFIED by 'the root'; ------- # modify the current user password for the root

Guess you like

Origin www.linuxidc.com/Linux/2019-10/161012.htm