当前位置:网站首页>Linux MySQL installation
Linux MySQL installation
2022-06-24 09:06:00 【Q z1997】
Liunx Mysql install
explain :
Linux There are usually three ways to install the software under : Binary system 、rpm、yum Three ways .
MySQL The download :
Because I use Alibaba cloud servers , Networked , So I'm directly in linux Download under , Use Windows You can also mysql Download the local file and upload it to the server
Attach the download link of the official website to download the software package in the server through the command line :
Official website : MySQL Download from the official website
Server download ( Connected to the Internet ):wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
Uninstall the original mysql
# see
rpm -qa | grep mysql
# If exist mysql The installation files , Is displayed mysql Installed version information
# Such as :mysql-connector-odbc-5.2.5-6.el7.x86_64
# uninstall
rpm -e --nodeps mysql-connector-odbc-5.2.5-6.el7.x86_64
Upload and download the installation package
decompression :tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
rename :mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql
Move :mv mysql /usr/local/
Add user group 、 user
groupadd mysql
useradd -g mysql mysql
establish data Directory and change permission
cd /usr/local/mysql
mkdir data
pwd
# /usr/local/mysql
chown -R mysql:mysql ./
To configure my.cnf
[root etc]# pwd
/etc
[root etc]# touch my.cnf
[mysql]
# Set up mysql Client default character set
default-character-set=utf8
socket=/tmp/mysql.sock
[mysqld]
#mysql Login without password
#skip-grant-tables
# Ban DNS analysis
#skip-name-resolve
# port
port=3306
socket=/tmp/mysql.sock
# Set up mysql Installation directory
basedir=/usr/local/mysql
# Set up mysql Database data storage directory
datadir=/usr/local/mysql/data
# Maximum connections allowed
max_connections=200
# The default character set used by the server
character-set-server=utf8
# The default storage index that will be used when creating a new table
default-storage-engine=INNODB
#lower_case_table_name=1
max_allowed_packet=16M
initialization mysql
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
# After execution, it will output : The red one is the initial password 
Set up mysql To start the machine automatically
# Copy mysql.server To init.d Under the table of contents
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod +x /etc/rc.d/init.d/mysqld
# Add service
chkconfig --add mysqld
# See if it is added successfully
chkconfig --list mysqld

Configure environment variables
vi /etc/profile
# Add the following
PATH=$PATH:/usr/local/mysql/bin
export PATH
# Make configuration effective
source /etc/profile
# Check whether the configuration is effective
echo $PATH
First login changes password
alter user ' user name '@'localhost | %' identified by ' password ';
alter user 'root'@'localhost' identified by 'Daxizi7724530!';
边栏推荐
- linux(centos7.9)安装部署mysql-cluster 7.6
- 【牛客】HJ1 字符串最后一个单词的长度
- Data midrange: analysis of full stack technical architecture of data midrange, with industry solutions
- Sword finger offer 55 - I. depth DFS method of binary tree
- threejs辉光通道01(UnrealBloomPass && layers)
- Why can ping fail while traceroute can
- “不平凡的代理初始值设定不受支持”,出现的原因及解决方法
- Become an IEEE student member
- Transplantation of xuantie e906 -- fanwai 0: Construction of xuantie c906 simulation environment
- 什么是图神经网络?图神经网络有什么用?
猜你喜欢

基于QingCloud的 “房地一体” 云解决方案

Data middle office: detailed explanation of technical architecture of data middle office

The list of open source summer winners has been publicized, and the field of basic software has become a hot application this year

110. balanced binary tree recursive method

用VNC Viewer的方式远程连接无需显示屏的树莓派

Telnet port login method with user name for liunx server

linux(centos7.9)安装部署mysql-cluster 7.6

数据中台:数据采集和抽取的技术栈详解

OpenCV每日函数 结构分析和形状描述符(7) 寻找多边形(轮廓)/旋转矩形交集

数据中台:数据中台技术架构详解
随机推荐
GradScaler MaxClipGradScaler
【Pytorch基础教程31】YoutubeDNN模型解析
Qingcloud based "real estate integration" cloud solution
1704. 判断字符串的两半是否相似
Prompt code when MySQL inserts Chinese data due to character set problems: 1366
[quantitative investment] discrete Fourier transform to calculate array period
Floating error waiting for changelog lock
Ebanb B1 Bracelet brush firmware abnormal interrupt handling
tcpdump抓包实现过程
Essay - Reflection
阿里资深软件测试工程师推荐测试人员必学——安全测试入门介绍
MySQL data (Linux Environment) scheduled backup
Data midrange: detailed explanation of the technical stack of data acquisition and extraction
[pytorch basic tutorial 30] code analysis of DSSM twin tower model
On the routing tree of gin
【PyTorch基础教程30】DSSM双塔模型代码解析
华为路由器:GRE技术
1528. rearrange strings
1844. 将所有数字用字符替换
怎么把mdf和ldf文件导入MySQL workbench中