当前位置:网站首页>Mysql database deployment and initialization steps
Mysql database deployment and initialization steps
2022-08-01 07:57:00 【Baldness - Tech Blog】
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言
一、Mysql源码下载
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-boost-5.7.36.tar.gz #Download the source code can be unpack and installation steps
二、cmake,gcc的升级
1.cmake升级
wget https://github.com/Kitware/CMake/releases/download/v3.24.0-rc3/cmake-3.24.0-rc3-macos10.10-universal.tar.gz
tar -zxf cmake-3.24.0-rc3-macos10.10-universal.tar.gz
cd cmake-3.24.0/
./configure #In the process of solving dependencies can be
make
2.gcc的安装升级
- 源码
GCC下载位置:http://ftp.gnu.org/gnu/gcc/
下载5.3版本以上即可
tar -zxf gcc-5.5.0.tar.gz
cd gcc-5.5.0/
./contrib/download_prerequisites #Can automatically download software required dependencies
mkdir build
cd build
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
#--enable-languages=c,c++所支持的语言
#--disable-multilibIn the process of compiling said he was "not to do extra checking
#–disable-multilib不生成编译为其他平台可执行代码的交叉编译器
make -j 4 && make install #Number of one-time compilation task does not usually exceedCPU核心数的2倍
The compilation process spent1个小时左右,It is recommended to use down the way to upgrade
- yum源安装
yum install centos-release-scl -y
yum install devtoolset-7-gcc* -y
scl enable devtoolset-7 bash
三、Mysql部署
1.源码编译
tar -zxf mysql-boost
mkdir build #Create a new directory in which the source code to compile and install
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ #Specify the installation directory location
-DMYSQL_DATADIR=/data/mysql \ #Specify the data directory location
-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock \ #Soft connection position
-DWITH_INNOBASE_STORAGE_ENGINE=1 \ #使用innodb存储引擎
-DSYSCONFDIR=/etc \ #指定配置文件所在目录
-DENABLED_LOCAL_INFILE=1 \ #Open the local import
-DWITH_EXTRA_CHARSETS=all \ #支持的字符集
-DDEFAULT_CHARSET=utf8mb4 \ #Specify the default character set used by
-DDEFAULT_COLLATION=utf8_general_ci \ #指定字符集
-DWITH_BOOST=/root/mysql-8.0.21/boost/boost_1_72_0 \ #指定boos库位置
-DDOWNLOAD_BOOST=1 \ #自动下载boosLibrary has been specified, don't need to download
make -j 2 && make install
2.rpm包安装
tar -xf mysql-5.7.31-1.el7.x86_64.rpm-bundle.tar
yum install mysql-community-client-5.7.31-1.el7.x86_64.rpm mysql-community-common-5.7.31-1.el7.x86_64.rpm mysql-community-libs-5.7.31-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.31-1.el7.x86_64.rpm mysql-community-server-5.7.31-1.el7.x86_64.rpm -y
3.yum源
yum install mysql -y
四、MySQL的初始化
1.启动
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
useradd -M -d /usr/local/mysql/ -s /sbin/nologin mysql
mkdir /usr/local/mysql/data
chown mysql.mysql /usr/local/mysql/data
vim .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
source ~/.bash_profile
2.初始化
vim /etc/my.cnf
[mysqld]
datadir=/usr/local/mysql #Specify the installation directory location
socket=/usr/local/mysql/data/mysql.sock #指定sock文件位置
datadir=/usr/local/mysql/data #Specify the data directory location
mysqld --initialize --user=mysql #To initialize the database specified users asmysql
总结
边栏推荐
- rhcsa 第四天
- 图片无损压缩软件哪个好用:试试完全免费的JPG-C 图片批量修整压缩减肥工具吧 | 最新jpg批量修整工具下载
- 22牛客多校1 J.Serval and Essay (启发式合并)
- How to generate and configure public key certificate in Alipay
- LevelSequence源码分析
- zip package all files in the directory (including hidden files/folders)
- pytest接口自动化测试框架 | 集成Allure测试报告
- 特殊的日子,值得纪念
- 2022杭电中超杯(1)个人题解
- Summary of test points about app updates in different ways
猜你喜欢
SaaS安全认证综合指南
巧妙利用unbuffer实时写入
VoLTE Basic Learning Series | Enterprise Voice Network Brief
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
app 自动化 通过工具查看app 元素 (三)
2022杭电中超杯(1)个人题解
微信小程序请求封装
Image lossless compression software which works: try completely free JPG - C image batch finishing compression reduces weight tools | latest JPG batch dressing tools download
SAP ABAP ALV+SMARTFORS 表分页 报表打印程序
app 自动化 打开app (二)
随机推荐
app 自动化 打开app (二)
special day to remember
Golang:go开启web服务
正则表达式符号
2022杭电多校第二场1011 DOS Card(线段树)
VoLTE基础学习系列 | 企业语音网简述
VSCode 快捷键及通用插件推荐
Mysql数据库的部署以及初始化步骤
微信小程序请求封装
HPC系统简介
Shell执行SQL发邮件
pytest接口自动化测试框架 | 执行失败跳转pdb
How to generate and configure public key certificate in Alipay
pytest接口自动化测试框架 | 跳过模块
最新的Cesium和Three的整合方法(附完整代码)
JVM内存模型之深究模型特征
pytest interface automation testing framework | single/multiple parameters
VoLTE Basic Learning Series | Enterprise Voice Network Brief
研发过程中的文档管理与工具
【STM32】入门(一):环境搭建、编译、下载、运行