当前位置:网站首页>Linux record -4.22 MySQL 5.37 installation (supplementary)
Linux record -4.22 MySQL 5.37 installation (supplementary)
2022-06-24 15:42:00 【lwj457700209】
MySQL Official website https://www.mysql.com/

Community Edition It's free.



Generic General Edition , Normal version
spot Archives Other versions , Enter the optional version number , spot download , Copy download link

install wget Tools
![]()
wget download 
( Of course win It's the same when you pass it up and down )
Delete the system's original mysql( If any ).
grep -i Ignore case .
![]()
rpm -ev Forcibly delete the packages found
![]()
find Check the previous mysql Catalog , And use rm -rf Delete the folder name
![]()
Delete my.cnf , Previously installed configuration files
rm -rf /etc/my.cnf
Unpack the installation

Rename and relocate 
Build directory , Data used to place the database .
![]()
see mysql Whether users and groups exist , Create if not
/etc/group View groups in
![]()
groupadd Create a group

useradd -M -s /sbin/nologin mysql Create a directory without login , Use the specified after login shell Of MySQL user .
useradd -g mysql mysql Add a new user to a group ( With the -g Then the group name ).
Appoint shell yes /sbin/nologin Indicates that the user is not logged in , The account is only used for services , For system security .
useradd -M -s /sbin/nologin -g mysql mysql

useradd Create a user
-M Don't automatically create /home/mysql This home directory , This is a User login directory .
( stay /etc/passwd see , Although it will show , But it's red , It's not real , See the picture below )
-r Set up a system account .
-g Group name Specify the group to which the user belongs .
-s Used after login shell name Specify the... Used by the user after login shell .
Set to /sbin/nologin You cannot log in to the system
Set to /bin/bash You can log in to the system .( default setting )
/etc/passwd View users in

chown Appoint mysql The owner of the data directory . That is, to set the owner , Generic group .
chown -R mysql:mysql /data/mysql
-R Express Process all files in the specified directory and its subdirectories

ls -la View hidden files , /data/mysql The primary group of the folder . . Is this folder .. Is the upper level folder
![]()



Start the display log No settings , Because you don't have write permission .
Another mistake is PID Can't find ,PID It really doesn't exist before it starts .

![]()

establish mysql.log No more errors will be reported , but PID Because there is no startup, there is still no .
![]()



Successful startup

At the end of installation A temporary password...... The default... Will be prompted [email protected] User's password .
[email protected] It means local root user .


At this time, log in directly root The account number reported an error and was not found socket file , although socket The file is already in the defined path /usr/local/mysql/mysql.sock It automatically generates , But I don't know why /tmp/mysql.sock This path looks for .
Now that I know the reason, I will add .
The current processing method is to generate mysql.sock and /tmp/ Make soft connection under .

stay database Under the path /bin start-up mysql , When the password contains ; It's direct -p+ Passwords plaintext The way of writing will be wrong , The system will assume that the command has ended by the semicolon .
Therefore, the password can only be entered through ciphertext . Landing successful .

When you log in, you will be prompted to use alter user To change the password to execute other commands .
The database also prompts like this .
direct alter user root Will fail , This is for Other than the current user User settings .
alter user user() To change The current user Password .
Modify the format of account and password (mysql5.7 Above version )
alter user user name identified by ' New password ';

边栏推荐
- Special topic of IM code scanning login Technology (III): easy to understand. A detailed principle of IM code scanning login function is enough
- QoS Technology in network
- Design of vga/lcd display controller system based on FPGA (Part 2)
- Teach you how to deploy the pressure test engine on Tencent cloud
- FPGA based analog I ² C protocol system design (medium)
- Three solutions for Jenkins image failing to update plug-in Center
- Kubernetes practical tips: using ksniff to capture packets
- MySQL binlog
- Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control
- Data stack technology sharing: how to use data stack for data collection?
猜你喜欢

设备通过国标GB28181接入EasyCVR平台,出现断流情况该如何解决?
Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

Left hand code, right hand open source, part of the open source road

Linux记录-4.22 MySQL5.37安装(补充)

Mongodb Getting started Practical Tutoriel: Learning Summary Table des matières

Mysql之Binlog

CVPR 2022 - Interpretation of selected papers of meituan technical team
![clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]](/img/f0/42f394dbc989d381387c7b953d2a39.jpg)
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]

刚刚阿里面软件测试回来,3+1面任职阿里P7,年薪28*15薪

Recommend several super practical data analysis tools
随机推荐
刚刚阿里面软件测试回来,3+1面任职阿里P7,年薪28*15薪
如何轻松实现在线K歌房,与王心凌合唱《山海》
leetcode 139. Word Break 单词拆分(中等)
clang: warning: argument unused during compilation: ‘-no-pie‘ [-Wunused-command-line-argument]
MySQL 开发规范
期货公司开户安全吗
Phpcms upgrade editor method -- simple and effective
practice
leetcode 139. Word Break 單詞拆分(中等)
07. Tencent cloud IOT device side learning - Data Template
Sequential representation and implementation of linear table (refer to YanWeiMin version)
Jenkins的便捷式安装
From practical teaching to competition exercise, Tencent experts personally teach Ti-One platform operation strategy!
Since the household appliance industry has entered the era of stock competition, why does Suning win the first channel for consecutive times?
Domestic payment system and payment background construction
Easynvr has been connected to the third-party supervision platform. How to achieve local Internet access
How to resolve the 35 year old crisis? Sharing of 20 years' technical experience of chief architect of Huawei cloud database
FPGA based analog I ² C protocol system design (medium)
【C语言刷题——Leetcode12道题】带你起飞,飞进垃圾堆
Design of vga/lcd display controller system based on FPGA (Part 2)