大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说每日一练 数据库linux安装[亲测有效],希望您对编程的造诣更进一步.
第一步:下载数据库
通过shell工具,采用xftp功能
第二步:解压数据包
mkdir mysql (在解压之前创建文件夹)
tar -xvf mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar -C mysql
可以将解压的文件放入到mysql文件夹中
第三步:安装mysql
根据截图内容,发现安装过程中出现了此问题。
缺少了一个步骤,需要先执行
yum install openssl-devel
然后在进行安装mysql相关的组件
-rw-r–r–. 1 root root 803604480 Jun 11 21:59 mysql-8.0.28-1.el8.x86_64.rpm-bundle.tar
-rw-r–r–. 1 7155 31415 14696536 Dec 18 05:12 mysql-community-client-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 35757244 Dec 18 05:12 mysql-community-client-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 2525324 Dec 18 05:12 mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 3059452 Dec 18 05:12 mysql-community-client-plugins-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 648016 Dec 18 05:12 mysql-community-common-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 3854428 Dec 18 05:12 mysql-community-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 22165576 Dec 18 05:12 mysql-community-debugsource-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 2277568 Dec 18 05:13 mysql-community-devel-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 2218888 Dec 18 05:13 mysql-community-icu-data-files-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 1565452 Dec 18 05:13 mysql-community-libs-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 3092836 Dec 18 05:13 mysql-community-libs-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 56040148 Dec 18 05:14 mysql-community-server-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 22887476 Dec 18 05:15 mysql-community-server-debug-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 102979324 Dec 18 05:15 mysql-community-server-debug-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 263295408 Dec 18 05:15 mysql-community-server-debuginfo-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 242279956 Dec 18 05:16 mysql-community-test-8.0.28-1.el8.x86_64.rpm
-rw-r–r–. 1 7155 31415 24238412 Dec 18 05:17 mysql-community-test-debuginfo-8.0.28-1.el8.x86_64.rpm
安装组件有先后顺序,请注意安装的次序。
rmp -ivh mysql-community-devel-8.0.28-1.el8.x86_64.rpm
可以在rpm 后面加上–nodeps –force,即安装时不检查依赖关系。
1.安装devel的组件
rpm -ivh mysql-community-devel-8.0.28-1.el8.x86_64.rpm --nodeps --force
2.安装客户端和服务端组件
[root@localhost mysql]# rpm -ivh mysql-community-client-8.0.28-1.el8.x86_64.rpm --nodeps --force warning: mysql-community-client-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-8.0.28-1.e################################# [100%] [root@localhost mysql]# rpm -ivh mysql-community-server-8.0.28-1.el8.x86_64.rpm --nodeps --force warning: mysql-community-server-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-server-8.0.28-1.e################################# [100%]
3. 然后根据需要安装相应的服务包
[root@localhost mysql]# rpm -ivh mysql-community-common-8.0.28-1.el8.x86_64.rpm --nodeps --force warning: mysql-community-common-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-common-8.0.28-1.e################################# [100%] [root@localhost mysql]# rpm -ivh mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm --nodeps --force warning: mysql-community-client-plugins-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-plugins-8.################################# [100%] [root@localhost mysql]# rpm -ivh mysql-community-libs-8.0.28-1.el8.x86_64.rpm --nodeps --force warning: mysql-community-libs-8.0.28-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 3a79bd29: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-libs-8.0.28-1.el8################################# [100%]
安装完成以后,可以启动MYSQL服务器。
第四步:启动MYSQL
systemctl start mysqld
mysql -u root -p
没有指定密码,会随机指定密码,可以通过vim /var/log/mysqld.log
本文来自思创斯聊编程,作者:大海之星,转载请注明原文链接:https://i.cnblogs.com/posts/signatures
原文地址:https://www.cnblogs.com/mm150144978/archive/2022/06/12/16367878.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/5123.html