tar xvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /usr/local/ cd /usr/local/ mv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql groupadd -u 800 mysql groupadd -g 800 mysql useradd -u 800 -g mysql mysql mkdir mysql/data chown -R mysql.mysql mysql cd mysql bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data cp mysql.server /etc/init.d/mysqld vim /etc/my.cnf [mysqld] user = mysql port = 3306 server_id = 1 socket=/tmp/mysql.sock basedir =/usr/local/mysql datadir =/usr/local/mysql/data # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid vim /etc/profile.d/mysql.sh export PATH=$PATH:/usr/local/mysql/bin . /etc/profile.d/mysql.sh chkconfig mysqld on service mysqld start
时间: 2024-10-29 19:13:29