您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關如何快速安裝MySQL5 - 8各版本腳本內容,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。
MySQL 5.5.62
#如果之前有MYSQL 那么先停服務 /etc/init.d/mysqld stop #如果之前已經裝過MYSQL 那么先備份數據目錄 tar -jcvf mysql.tar.bz2 /var/lib/mysql #卸載之前已經安裝過的MYSQL軟件RPM rpm -qa|grep mysq| xargs rpm -e --nodeps #下載MYSQL 5.5.62 wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-common-5.5.62-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-compat-5.5.62-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-5.5.62-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-client-5.5.62-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-server-5.5.62-2.el6.x86_64.rpm #安裝 rpm -ivh mysql-community-libs-compat-5.5.62-2.el6.x86_64.rpm mysql-community-client-5.5.62-2.el6.x86_64.rpm mysql-community-common-5.5.62-2.el6.x86_64.rpm mysql-community-libs-5.5.62-2.el6.x86_64.rpm mysql-community-server-5.5.62-2.el6.x86_64.rpm 修改/etc/my.cnf 中的 datadir 到 你要的目錄 mkdir /@@datadir chown mysql:mysql /@@datadir mysql_install_db chown -R mysql:mysql /@@datadir mysqld_safe & mysql SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mysql'); FLUSH PRIVILEGES; exit /etc/init.d/mysqld stop /etc/init.d/mysqld start mysql -uroot -pmysql
MySQL 5.6.46
#如果之前有MYSQL 那么先停服務 /etc/init.d/mysqld stop #如果之前已經裝過MYSQL 那么先備份數據目錄 tar -jcvf mysql.tar.bz2 /var/lib/mysql #卸載之前已經安裝過的MYSQL軟件RPM rpm -qa|grep mysq| xargs rpm -e --nodeps #下載MYSQL 5.6.46 wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-common-5.6.46-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-compat-5.6.46-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-5.6.46-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-client-5.6.46-2.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-server-5.6.46-2.el6.x86_64.rpm #安裝 rpm -ivh mysql-community-libs-compat-5.6.46-2.el6.x86_64.rpm mysql-community-libs-5.6.46-2.el6.x86_64.rpm mysql-community-client-5.6.46-2.el6.x86_64.rpm mysql-community-common-5.6.46-2.el6.x86_64.rpm mysql-community-server-5.6.46-2.el6.x86_64.rpm 修改/etc/my.cnf 中的 datadir 到 你要的目錄 mkdir /@@datadir chown mysql:mysql /@@datadir mysql_install_db chown -R mysql:mysql /@@datadir mysqld_safe & mysql SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mysql'); FLUSH PRIVILEGES; exit /etc/init.d/mysqld stop /etc/init.d/mysqld start mysql -uroot -pmysql
MySQL 5.7.28
>#如果之前有MYSQL 那么先停服務 /etc/init.d/mysqld stop #如果之前已經裝過MYSQL 那么先備份數據目錄 tar -jcvf mysql.tar.bz2 /var/lib/mysql #卸載之前已經安裝過的MYSQL軟件RPM rpm -qa|grep mysq| xargs rpm -e --nodeps #下載MYSQL 5.7.28 wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-common-5.7.28-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-compat-5.7.28-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-5.7.28-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-client-5.7.28-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-server-5.7.28-1.el6.x86_64.rpm rpm -ivh mysql-community-common-5.7.28-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.28-1.el6.x86_64.rpm mysql-community-libs-5.7.28-1.el6.x86_64.rpm mysql-community-client-5.7.28-1.el6.x86_64.rpm mysql-community-server-5.7.28-1.el6.x86_64.rpm 修改/etc/my.cnf 中的 datadir 到 你要的目錄 mkdir /@@datadir chown mysql:mysql /@@datadir mysqld --initialize chown -R mysql:mysql /@@datadir mysqld_safe --skip-grant-tables & mysql UPDATE mysql.user SET authentication_string = PASSWORD('mysql') , password_expired = 'N' WHERE User = 'root' AND Host = 'localhost'; FLUSH PRIVILEGES; exit /etc/init.d/mysqld stop /etc/init.d/mysqld start mysql -uroot -pmysql
MySQL 8.0.17
>>#如果之前有MYSQL 那么先停服務 /etc/init.d/mysqld stop #如果之前已經裝過MYSQL 那么先備份數據目錄 tar -jcvf mysql.tar.bz2 /var/lib/mysql #卸載之前已經安裝過的MYSQL軟件RPM rpm -qa|grep mysq| xargs rpm -e --nodeps #下載MYSQL 8.0.17 wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-common-8.0.17-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-libs-8.0.17-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-client-8.0.17-1.el6.x86_64.rpm wget --no-check-certificate https://zcdn.askmaclean.com/mysql-community-server-8.0.17-1.el6.x86_64.rpm rpm -ivh mysql-community-client-8.0.17-1.el6.x86_64.rpm mysql-community-common-8.0.17-1.el6.x86_64.rpm mysql-community-libs-8.0.17-1.el6.x86_64.rpm mysql-community-server-8.0.17-1.el6.x86_64.rpm 修改/etc/my.cnf 中的 datadir 到 你要的目錄 mkdir /@@datadir chown mysql:mysql /@@datadir mysqld --initialize chown -R mysql:mysql /@@datadir mysqld_safe --skip-grant-tables & mysql UPDATE mysql.user SET authentication_string=null WHERE User='root'; FLUSH PRIVILEGES; exit; /etc/init.d/mysqld stop /etc/init.d/mysqld start mysql ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql'; FLUSH PRIVILEGES; exit; mysql -uroot -pmysql
關于如何快速安裝MySQL5 - 8各版本腳本內容就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。