Error messages, dictionary, and SQL for database installation
support-files
Miscellaneous support files
六、安装步骤
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$> groupadd mysql $> useradd -r -g mysql -s /bin/false mysql $> cd /usr/local $> tar xvf /path/to/mysql-VERSION-OS.tar.xz $> ln -s full-path-to-mysql-VERSION-OS mysql $> cd mysql $> mkdir mysql-files $> chown mysql:mysql mysql-files $> chmod 750 mysql-files $> bin/mysqld --initialize --user=mysql $> bin/mysql_ssl_rsa_setup $> bin/mysqld_safe --user=mysql & # Next command is optional $> cp support-files/mysql.server /etc/init.d/mysql.server
The mysql-files directory provides a convenient location to use as the value for the secure_file_priv system variable, which limits import and export operations to a specific directory. SeeSection5.1.8, “ServerSystemVariables”.
七、创建用户及组
Because the user is required only for ownership purposes, not login purposes, the useradd command uses the -r and -s /bin/false options to create a user that does not have login permissions to your server host. Omit these options if your useradd does not support them.
1 2
groupadd mysql useradd -r -g mysql -s /bin/false mysql
八、解压
1 2 3 4 5
tar xvf mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz -C /usr/local/ 如果不想创建软链接,可以提前创建mysql文件夹,然后解压使用--strip-components参数将文件直接解压到/usr/local/mysql根目录: mkdir /usr/local/mysql tar -xvf mysql-8.0.32-linux-glibc2.12-x86_64.tar.xz -C /usr/local/mysql --strip-components=1
九、创建软链接
1 2 3 4
cd /usr/local/ ln -s mysql-8.0.32-linux-glibc2.12-x86_64 mysql
chown -R root.root mysql/*
十、添加环境变量
1 2 3 4
# vi /etc/profile export PATH=$PATH:/usr/local/mysql/bin