不少童鞋不懂這麼在Linux系統安裝MySQL,網上大多數教程較複雜,不太適合小白安裝,本教程提供一鍵安裝腳本供你們使用,教你們怎麼在Linux操做系統(mysql
支持CentOS/Ubuntu/Debian/Fedora/Arch Linux)下快速安裝MySQL(支持5.1/5.2/5.4/5.6/5.7/6.0/8.0版本),方便快速,提高學習、工做效率!linux
連接:https://pan.baidu.com/s/1vy-LQl5awyuCgyhui6oHMA sql
提取碼:ol38bash
連接:https://pan.baidu.com/s/12yZSw7n7RNRrrE4oHz3zuA app
提取碼:h1pl學習
sudo bash mysql_glibc_install.sh 5.7.29 root123456ui
第一個5.7.29是安裝包的版本號,好比安裝包爲: mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz , 版本號就是mysql-後面的數字,必定要對應!必定要對應!必定要對應!操作系統
第二個參數root123456是你要設置的mysql root帳戶的密碼,可自定義。rest
source /etc/profileblog
sudo /etc/init.d/mysqld start
如下爲經常使用命令
啓動: sudo /etc/init.d/mysqld start
重啓: sudo /etc/init.d/mysqld restart
中止: sudo /etc/init.d/mysqld stop
狀態: sudo /etc/init.d/mysqld status
若有service命令,也能夠
啓動: sudo service mysqld start
重啓: sudo service mysqld restart
中止: sudo service mysqld stop
狀態: sudo service mysqld status
若是沒有service命令,有systemctl命令的話,也能夠
啓動: sudo systemctl start mysqld
重啓: sudo systemctl restart mysqld
中止: sudo systemctl stop mysqld
狀態: sudo systemctl status mysqld
mysql -uroot -proot123456
其中root123456爲root用戶的密碼,是你開始安裝的時候的自定義密碼!!!
如圖所示安裝成功!!!Go Go!!!
mysql默認安安裝路徑: /opt/app/mysql
mysql默認數據路徑:/opt/mysql_data
mysql配置文件路徑: /etc/my.cnf
mysql默認所屬用戶組與用戶爲: mysql:mysql
如需更改能夠本身修改腳本內容(不會改不要亂改,默認就行)!!!