目录
1 环境检查
2 下载MysqL
mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar
3 上传Linux服务器
4 解压缩
- tar xvf MysqL-5.7.19-1.el7.x86_64.rpm-bundle.tar -C /stage/MysqL/
-
- [root@localhost stage]# ll MysqL/
- total 578984
- -rw-r--r--. 1 7155 31415 25085192 Jun 24 08:08 MysqL-community-client-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 278292 Jun 24 08:08 MysqL-community-common-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 3778852 Jun 24 08:08 MysqL-community-devel-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 46236988 Jun 24 08:08 MysqL-community-embedded-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 24077820 Jun 24 08:08 MysqL-community-embedded-compat-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 128296360 Jun 24 08:09 MysqL-community-embedded-devel-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 2238032 Jun 24 08:09 MysqL-community-libs-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 2115696 Jun 24 08:09 MysqL-community-libs-compat-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 55456196 Jun 24 08:09 MysqL-community-minimal-debuginfo-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 171537176 Jun 24 08:09 MysqL-community-server-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 15258732 Jun 24 08:09 MysqL-community-server-minimal-5.7.19-1.el7.x86_64.rpm
- -rw-r--r--. 1 7155 31415 118490200 Jun 24 08:10 MysqL-community-test-5.7.19-1.el7.x86_64.rpm
5 安装MysqL
6 启动MysqL
- /bin/systemctl start MysqLd.service
启动脚本已经安装了,位置在:
- /usr/lib/systemd/system/MysqLd.service
脚本内容
- [Unit]
- Description=MysqL Server
- Documentation=man:MysqLd(8)
- Documentation=http://dev.MysqL.com/doc/refman/en/using-systemd.html
- After=network.target
- After=syslog.target
-
- [Install]
- WantedBy=multi-user.target
-
- [Service]
- User=MysqL
- Group=MysqL
-
- Type=forking
-
- PIDFile=/var/run/MysqLd/MysqLd.pid
-
- # Disable service start and stop timeout logic of systemd for MysqLd service.
- TimeoutSec=0
-
- # Execute pre and post scripts as root
- PermissionsStartOnly=true
-
- # Needed to create system tables
- ExecStartPre=/usr/bin/MysqLd_pre_systemd
-
- # Start main service
- ExecStart=/usr/sbin/MysqLd --daemonize --pid-file=/var/run/MysqLd/MysqLd.pid $MysqLD_OPTS
-
- # Use this to switch malloc implementation
- EnvironmentFile=-/etc/sysconfig/MysqL
-
- # Sets open_files_limit
- LimitNOFILE = 5000
-
- Restart=on-failure
-
- RestartPreventExitStatus=1
-
- PrivateTmp=false
7 找到初始密码
8 安全初始化MysqL
- /usr/bin/MysqL_secure_installation
-
-
-
- Server@234
9 连接测试
@H_502_631@
done!