Mysql5.7.19安裝步驟
阿新 • • 發佈:2018-07-05
啟動 輸入 linux p s lin 修改 chown erro event Mysql5.7.19安裝步驟
創建/etc/my.cnf文件,內容如下:
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
user=mysql
character-set-server=utf8
mysql>set password=password(‘Zhxg@2018!‘);
mysql> flush privileges;
1、下載
下載地址:http://mirror.switch.ch/mirror/mysql/Downloads
2、安裝
#tar zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local
#Cd /usr/local
#Mv mysql-5.7.19-linux-glibc2.12-x86_64 mysql
#groupadd mysql
useradd -r -g mysql -s /bin/false mysql
#cd /usr/local/mysql
#mkdir mysql-files data
#chown -R mysql.mysql .
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
socket=/tmp/mysql.sock
user=mysql
character-set-server=utf8
Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/tmp/mysqld.pid
#########################################################################
#bin/mysql_install_db --user=mysql #mysql5.7.5用此方式初始化
#bin/mysqld --defaults-file=/etc/my.cnf --initialize --user=mysql #mysql5.7.6及以上用此方式初始化,註意最後的臨時密碼
cp support-files/mysql.server /etc/init.d/mysqld
#ln -s /usr/local/mysql/bin/* /usr/local/bin/
3、啟動mysql
bin/mysqld_safe --user=mysql &
4、修改密碼
#mysql -uroot -p #回車,輸入初始密碼
mysql> flush privileges;
Mysql5.7.19安裝步驟