当前位置:网站首页>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.
边栏推荐
猜你喜欢
阿里大牛最新总结分享的高并发编程核心笔记(终极版),高并发系统架构场景一应俱全
Lecture 2 Software Life Cycle
Petri网-2、有向网
[A summary of the sorting and use of activation functions in deep learning]
使用华为HECS云服务器打造Telegraf+Influxdb+Grafana 监控系统【华为云至简致远】
大势,又一关乎中美竞争的关键行业,走到关键时刻了
162_Power Query 快速合并文件夹中表格之自定义函数 TableXlsxCsv_2.0
Mysql 生成排序序号
如何把MapGIS的区文件转为ArcGIS的SHAPE面文件
网络通信的过程
随机推荐
petri网-1、概论
致一位湖南女孩
Petri网-2、有向网
Controller层代码这么写,简洁又优雅!
进程通信的方式
servlet与jsp区别_servlet和class的区别
Chrome browser corresponding driver_chrome mobile browser
正则表达式入门二(普通字符)
leetcode 448. Find All Numbers Disappeared in an Array 找到所有数组中消失的数字(简单)
MySQL面试必备(一)基础篇
Lecture 2 Software Life Cycle
【R语言科研绘图】--- 柱状图
个人秋招记录——欢迎交流
Day1:面试必考真题
MySQL【存储过程与函数】
How to use matlab to implement the piecewise function "recommended collection"
兆骑科创高层次人才引进平台,创新创业赛事活动路演
CVPR 2022 | 从人体网格预测骨架,是真正的生理学骨架!
PAT乙级-B1008 数组元素循环右移问题(20)
网络通信的过程