时间:2021-07-01 10:21:17 帮助过:21人阅读
[root@localhost ~]# mysqld --initialize-insecure --user=mysql --datadir=/data/3307/data --basedir=/usr/local/mysql8 [root@localhost ~]# mysqld --initialize-insecure --user=mysql --datadir=/data/3308/data --basedir=/usr/local/mysql8 [root@localhost ~]# mysqld --initialize-insecure --user=mysql --datadir=/data/3309/data --basedir=/usr/local/mysql8
[root@localhost ~]# cat >> /etc/systemd/system/mysqld3307.service <<EOF > [Unit] > Description=MySQL Server > Documentation=man:mysqld(8) > Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html > After=network.target > After=syslog.target > [Install] > WantedBy=multi-user.target > [Service] > User=mysql > Group=mysql > ExecStart=/usr/local/mysql8/bin/mysqld --defaults-file=/data/3307/my.cnf > LimitNOFILE = 5000 > EOF [root@localhost ~]# cat >> /etc/systemd/system/mysqld3308.service <<EOF [Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql ExecStart=/usr/local/mysql8/bin/mysqld --defaults-file=/data/3308/my.cnf LimitNOFILE = 5000 EOF [root@localhost ~]# cat >> /etc/systemd/system/mysqld3309.service <<EOF [Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql ExecStart=/usr/local/mysql8/bin/mysqld --defaults-file=/data/3309/my.cnf LimitNOFILE = 5000 EOF
[root@localhost ~]# systemctl start mysqld3307 [root@localhost ~]# systemctl start mysqld3308 [root@localhost ~]# systemctl start mysqld3309
MySQL多实例配置
标签:mysq cat targe service bsp col ecs html systemctl