linux mysql命令安装
时间: 2023-11-07 07:03:33 浏览: 113
linux mysql安装
在Linux上安装MySQL的命令如下:
1. 下载MySQL的repo源:wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm (如果没有wget命令,请先执行yum -y install wget)
2. 安装mysql-community-release-el7-5.noarch.rpm包:rpm -ivh mysql-community-release-el7-5.noarch.rpm
3. 安装mysql-server:yum install -y mysql-server
4. 启动MySQL:service mysqld start
5. 设置开机自启动:chkconfig mysqld on
6. 安装mysql-connector-java:yum install -y mysql-connector-java
7. 初始化密码(设置root密码):mysql_secure_installation
完成上述步骤后,MySQL就成功安装在Linux系统上了。
阅读全文