当前位置:网站首页>Several methods of installing Mysql in Linux
Several methods of installing Mysql in Linux
2022-08-03 14:45:00 【MZdzt】
Several ways of database installation
1, yum online installation
(1) Download the official yum repository of MYSQl
[[email protected]~]#dnf install https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm
(2) Install MYSQL service
[[email protected] ~]# dnf install mysql-server
(3) Start the service
[[email protected] ~]# systemctl start mysqld
(4) View the initial password
[[email protected] ~]# grep 'temporary password' /var/log/mysqld.log
(5) Log in with the initial password
[[email protected] ~]# mysql -uroot -pEnter password: temporary password
(6) Change the password (note: uppercase and lowercase plus symbols)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'XXXXXXXXX';
2, rpm local installation
(1) Download the rpm package from the MYSQL official website
(2) Transfer the rpm package from windows to linux via ftp
(3) Unzip the rpm package
[[email protected] ~]# tar -xzvf mysql-8.0.30-1.el9.x86_64.rpm-bundle.tar
(4) dnf/yum for installation
[[email protected] ~]# dnf localinstall mysql-community-server-8.0.30-1.el9.x86_64.rpm \mysql-community-client-8.0.30-1.el9.x86_64.rpm\mysql-community-common-8.0.30-1.el9.x86_64.rpm\mysql-community-icu-data-files-8.0.30-1.el9.x86_64.rpm\mysql-community-libs-8.0.30-1.el9.x86_64.rpm\mysql-community-client-plugins-8.0.30-1.el9.x86_64.rpm
(5) Start the service
[[email protected] ~]# systemctl start mysqld
(6) View the initial password
[[email protected] ~]# grep 'temporary password' /var/log/mysqld.log
(7) Log in with the initial password
[[email protected] ~]# mysql -uroot -pEnter password: temporary password
(8) Change the password (note: uppercase and lowercase plus symbols)
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'XXXXXXXXX';
3. Install MYSQL from source code
(1) Create a directory mysql and transfer the source package to this directory and decompress it
[[email protected] ~]# mkdir /mysql[[email protected] ~]# mv mysql-boost-8.0.29.tar.gz /mysql/[[email protected] ~]# cd /mysql/[[email protected] mysql]# tar xvf mysql-boost-8.0.29.tar.gz
(2) Enter the directory after the decompression is completed, and add the group and group members
[[email protected] mysql]# cd mysql-8.0.29/[[email protected] mysql-8.0.29]# groupadd mysql[[email protected] mysql-8.0.29]# useradd -r -g mysql -s /bin/false mysql
(3) Create a bld file, switch to this file and download the packages needed for the next compilation
[[email protected] mysql-8.0.29]# mkdir bld[[email protected] mysql-8.0.29]# cd bld/[[email protected] bld]# dnf install cmake gcc gcc-c++[[email protected] bld]# yum install gcc-toolset-11-gcc gcc-toolset-11-gcc-c++ gcc-toolset-11-binutils ncurses-devel libtirpc-devel
(4) At this time, the download will report an error, because there is no rpcgen package in the local warehouse, which requires us to download it by ourselves
[[email protected] bld]# rpm -i rpcgen-1.3.1-4.el8.x86_64.rpm
(5) Start cmake
[[email protected] bld]# cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=../boost/boost_1_77_0/
(6) make; mark install
[[email protected] bld]# make;make install
(7) After method 1 or 2, start the service, check the initial password, log in, and change the password.
边栏推荐
- LeetCode15:三数之和
- 【深度学习中的激活函数的整理与使用总结】
- 英文邮件总结
- Controller层代码这么写,简洁又优雅!
- 哥斯拉加密WebShell过杀软
- 三元表达式实现多个条件的判断
- PAT乙级-B1012 数字分类(20)
- 微服务的快速开始(nacos)最全快速配置图解
- 为什么手动启动GBase 8c数据库中GTM节点,起不来。显示“Run cmd failed:scp: /tmp/gtm_gtm1.server: Permission denied”
- 162_Power Query is a custom function for quickly merging tables in a folder TableXlsxCsv_2.0
猜你喜欢
随机推荐
GBase 8c数据库集群中,怎么替换节点呢?比如设置A节点为gtm,换到B节点上。
十大免费代理ip软件_国内静态ip代理软件
Petri网-2、有向网
利用 NFT 释放网站的潜力
线程的状态
如何使用matlab实现分段函数「建议收藏」
使用Typora+EasyBlogImageForTypora写博客,无图床快速上传图片
【实战】Next.js + 云函数开发一个面试刷题网站
MySQL【视图】
数字孪生的4个最佳实践
哥斯拉加密WebShell过杀软
阿里大牛最新总结分享的高并发编程核心笔记(终极版),高并发系统架构场景一应俱全
网络数据集-骨干网和校园网-IP流量
Jupyter Notebook 交互式编程 & 低代码拖拽式编程 | 数据科学生态下的理想平台
【问题】使用pip安装第三方库的时候遇到“timeout”的解决方法
PAT乙级-B1017 A除以B(20)
[A summary of the sorting and use of activation functions in deep learning]
兔起鹘落全端涵盖,Go lang1.18入门精炼教程,由白丁入鸿儒,全平台(Sublime 4)Go lang开发环境搭建EP00
15 years of software architect experience summary: In the ML field, 5 pits that beginners have stepped on
redis的使用方法