如何快速安装MySQL5 - 8各版本脚本内容
短信预约 -IT技能 免费直播动态提醒
这篇文章将为大家详细讲解有关如何快速安装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各版本脚本内容就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341