当前位置:网站首页>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!';
边栏推荐
- “不平凡的代理初始值设定不受支持”,出现的原因及解决方法
- Fast and slow pointer series
- JS to find and update the specified value in the object through the key
- 阿里资深软件测试工程师推荐测试人员必学——安全测试入门介绍
- tcpdump抓包实现过程
- 【LeetCode】541. Reverse string II
- 什么是图神经网络?图神经网络有什么用?
- "Unusual proxy initial value setting is not supported", causes and Solutions
- Data middle office: a collection of middle office construction architectures of large domestic factories
- 解决:模型训练时loss出现nan
猜你喜欢

Matlab camera calibrator camera calibration

I heard that you are still spending money to buy ppt templates from the Internet?

普通人没有学历,自学编程可以月入过万吗?

MySQL | store notes of Master Kong MySQL from introduction to advanced
![[quantitative investment] discrete Fourier transform to calculate array period](/img/0d/aac02463ff403fb1ff871af5ff91fa.png)
[quantitative investment] discrete Fourier transform to calculate array period

YOLOX backbone——CSPDarknet的实现

Transplantation of xuantie e906 -- fanwai 0: Construction of xuantie c906 simulation environment

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

China chip Unicorn Corporation

解决:jmeter5.5在win11下界面上的字特别小
随机推荐
Data middle office: the data middle office practice scheme of Minsheng Bank
数据中台:国内大厂中台建设架构集锦
Spark - the number of leftouterjoin results is inconsistent with that of the left table
What is SRE? A detailed explanation of SRE operation and maintenance system
110. balanced binary tree recursive method
Ordinary people have no education background. Can they earn more than 10000 yuan a month by Self-taught programming?
基于QingCloud的地理信息企业研发云解决方案
Deep learning and neural networks: the six most noteworthy trends
110. 平衡二叉树-递归法
【MySQL从入门到精通】【高级篇】(一)字符集的修改与底层原理
【LeetCode】387. First unique character in string
Pytorch读入据集(典型数据集及自定义数据集两种模式)
十二、所有功能实现效果演示
GradScaler MaxClipGradScaler
[Niuke] convert string to integer
1528. 重新排列字符串
Analyze the meaning of Internet advertising terms CPM, CPC, CPA, CPS, CPL and CPR
常用表情符号
Prompt code when MySQL inserts Chinese data due to character set problems: 1366
216. 组合总和 III-枚举法