打开服务面板,查看有没有安装过mysql
下载完成后,解压到c:/mysql
-
mysqld.exe 服务器主进程程序
-
mysql.exe 客户端 mysql -uroot
卸载当前mysql
2.2 Linux 安装mysql
-
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm 下载 yum源
-
rpm -ivh mysql80-community-release-el8-1.noarch.rpm
-
yum install mysql-server -y
安装完成后
systemctl restart mysqld
systemctl status mysqld
mysql -uroot
mysql>select version(); 版本号
systemctl enable mysqld 设置开机自动启动
-
查看防火墙 systemctl status firewalld
-
设置mysql允许通过防火墙 firewall-cmd --zone=public --add-port=3306/tcp --permanent
-
firewall-cmd –reload 重新加载防火墙规则
-
停止服务 systemctl stop mysqld
-
卸载 mysql yum remove mysql-server -y
-
create user admin identified by ‘123456’; 建立账号,必须先登录
-
grant * on *.* to admin; 给admin账号授所有权限。