当前位置:网站首页>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 ';

边栏推荐
- MySQL 开发规范
- Arrays API
- Typescript raw data type
- MySQL replication series 6- tables related to replication information
- Es search content top
- Junit5中的参数化测试(Parameterized Tests)指南
- asciinema 搭配 asciicast2gif 实现高效的命令行终端录制能力
- 【C语言刷题——Leetcode12道题】带你起飞,飞进垃圾堆
- Teach you how to deploy the pressure test engine on Tencent cloud
- This website teaches you to imitate more than 100 well-known websites!
猜你喜欢

Mongodb Getting started Practical Tutoriel: Learning Summary Table des matières
Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control

Wi-Fi 7 来啦,它到底有多强?

熬夜整理出的软件测试【高频】面试题大全(2022最新)

Vim编辑器的最常用的用法
![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]

推荐几款超级实用的数据分析利器

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

CVPR 2022 - Interpretation of selected papers of meituan technical team

Remote connection raspberry pie in VNC Viewer Mode
随机推荐
手机同花顺股票开户安全吗!
Low fidelity prototype vs high fidelity prototype, which one is more suitable for your design?
Attacked! Cloud development monitoring alarm practice
Step by step introduction to sqlsugar based development framework (9) -- Realizing field permission control with WinForm control
How to modify the login user name of easynvr video monitoring system?
How about stock online account opening and account opening process? Is it safe to open an account online?
Domestic payment system and payment background construction
How to use nested tags in thymeleaf3 Tags
Improving the classification of motor imagery by combining EEG and MEG signals in BCI
How to achieve long-term development of voice social source code?
MySQL toolset: the official performance testing tool mysqlslap
Design of CAN bus controller based on FPGA (Part 2)
Why is the blackmail virus that shut down half of America's energy system terrible? Interpretation of authoritative reports
US Senate promotes bipartisan gun safety bill
The future of robots -- deep space exploration
Very exciting! 12000 words summarized the theory of network technology, reviewing the old and learning the new
PHP application container deployment practice
Easy installation of Jenkins
Leetcode 139. Mot break word Split (medium)
Cloud + community [play with Tencent cloud] essay solicitation activity winners announced