当前位置:网站首页>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!';
边栏推荐
- 【LeetCode】387. First unique character in string
- KaFormer个人笔记整理
- Threejs glow channel 01 (unrealbroompass & layers)
- 1528. rearrange strings
- 解决:jmeter5.5在win11下界面上的字特别小
- "I can't understand Sudoku, so I choose to play Sudoku."
- MySQL - SQL statement
- 【E325: ATTENTION】vim编辑时报错
- Implementation process of tcpdump packet capturing
- 【LeetCode】541. 反转字符串 II
猜你喜欢

The form image uploaded in chorme cannot view the binary image information of the request body

Data midrange: detailed explanation of the technical stack of data acquisition and extraction
![[use picgo+ Tencent cloud object to store cos as a map bed]](/img/14/d650960cc77385504ea5e2e138bd46.jpg)
[use picgo+ Tencent cloud object to store cos as a map bed]

MySQL | 视图《康师傅MySQL从入门到高级》笔记

陆奇:我现在最看好这四大技术趋势

从华为WeAutomate数字机器人论坛,看政企领域的“政务新智理”

What is SRE? A detailed explanation of SRE operation and maintenance system

How to configure environment variables and distinguish environment packaging for multi terminal project of uniapp development

MySQL | 存储《康师傅MySQL从入门到高级》笔记

【LeetCode】387. 字符串中的第一个唯一字符
随机推荐
华为路由器:ipsec技术
1528. rearrange strings
陆奇:我现在最看好这四大技术趋势
1704. judge whether the two halves of a string are similar
216. 组合总和 III-枚举法
How to import MDF and LDF files into MySQL workbench
[pytorch basic tutorial 30] code analysis of DSSM twin tower model
110. balanced binary tree recursive method
关于 GIN 的路由树
Essay - Reflection
Telnet port login method with user name for liunx server
"I can't understand Sudoku, so I choose to play Sudoku."
How to configure environment variables and distinguish environment packaging for multi terminal project of uniapp development
数据中台:国内大厂中台建设架构集锦
目标检测系列——Fast R-CNN
Data middle office: overview of data governance
[Niuke] length of the last word of HJ1 string
1704. 判断字符串的两半是否相似
数据中台:数据中台技术架构详解
Huawei Router: IPSec Technology