shell> groupadd mysqlshell> useradd -r -g mysql mysqlshell> cd /usr/localshell> tar zxvf /path/to/mysql-VERSION-OS.tar.gzshell> ln -s full-path-to-mysql-VERSION-OS mysqlshell> cd mysql ##如没有data目录,自建shell> mkdir mysql-filesshell> chmod 770 mysql-filesshell> chown -R mysql .shell> chgrp -R mysql .shell> bin/mysql_install_db --user=mysql #Before MySQL 5.7.6shell> bin/mysqld --initialize --user=mysql #MySQL 5.7.6 and upshell> bin/mysql_ssl_rsa_setup #MySQL 5.7.6 and upshell> chown -R root .shell> chown -R mysql data mysql-filesshell> bin/mysqld_safe --user=mysql &# Next command is optionalshell> cp support-files/mysql.server /etc/init.d/mysql.server
时间: 2024-10-10 07:07:19