当前位置:网站首页>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
总结
边栏推荐
猜你喜欢
随机推荐
JVM: Runtime Data Area - PC Register (Program Counter)
Golang:go开启web服务
USB Protocol (2) Terminology
企业数据虚拟化综合指南
Golang: go to connect and use mysql
22牛客多校1 I. Chiitoitsu (概率dp)
VoLTE基础学习系列 | 企业语音网简述
pytest interface automation testing framework | skip test classes
2022杭电中超杯(1)个人题解
套接字选项
Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice
Upgrade to heavyweight lock, lock reentrancy will lead to lock release?
网络基础学习
centos 安装php7.4,搭建hyperf,转发RDS
How to use Photoshop to composite star trail photos, post-processing method of night sky star trail photos
Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
Vim扩展内容
图片无损压缩软件哪个好用:试试完全免费的JPG-C 图片批量修整压缩减肥工具吧 | 最新jpg批量修整工具下载
special day to remember
监听父元素宽高,自适应插件大小