1.Download MySQL Community Server 訪問mysql官方網站轉到下載頁https://dev.mysql.com/downloads/mysql/5.6.html#downloads 選擇mysql-community-5.6版本 2.解壓安裝包 3.創建用戶組,授權 ...
1.Download MySQL Community Server
訪問mysql官方網站轉到下載頁https://dev.mysql.com/downloads/mysql/5.6.html#downloads
選擇mysql-community-5.6版本
2.解壓安裝包
tar zxvf mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.43-linux-glibc2.12-x86_64 /usr/local/mysql
3.創建用戶組,授權
useradd mysql -s /sbin/nologin –M
chown -R mysql:mysql /usr/local/mysql/
4.初始化資料庫
cd /usr/local/mysql/scripts&&./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
5.啟動資料庫
cd /usr/local/mysql/support-files&&./mysql.server start
6.更改root密碼
cd /usr/local/mysql/bin&&./mysqladmin -uroot -p password