1.输入网址https://www.mysql.com/downloads/,进入downloads,选择Community
2.选择对应的版本和系统;
输入命令:wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-1.el6.x86_64.rpm-bundle.tar 下载
3. 解压缩
tar -xvf mysql-5.7.19-1.el6.x86_64.rpm-bundle.tar
4.rpm安装
rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.19-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.19-1.el6.x86_64.rpm
5.安装成功后,修改my.cnf文件,添加user=root
vi /etc/my.cnf
6.初始化数据库
输入命令:mysqld --initialize-insecure
7.启动
输入命令:mysqld
这种启动方法
或者 nohup mysqld & 方式启动
时间: 2024-12-12 11:54:56