官网下载
选择适合自己版本下载下载地址
点击下载,在跳出的页面选择No thanks, just start my download
配置
将下载的文件解压,将它放在我们电脑某个盘中
配置变量
将文件解压之后,还要进行一些变量的配置。
将解压之后的bin路径添加到Path
检查是否添加成功
以管理员身份运行cmd,输入mysql并回车,若提示ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
本文参考51CTO博客作者wjw555的作品
脚本内容:
vim install.mysql.sh
#!/bin/bash
[ -f /etc/init.d/functions ]&& . /etc/init.d/functions
###Check if user is root
if [ $UID -ne 0 ]; then
echo Error: You must be root to run this scr ipt, please use root to install
exit