当前位置:网站首页>Linux MySQL 5.6.51 community generic installation tutorial
Linux MySQL 5.6.51 community generic installation tutorial
2022-07-02 06:40:00 【The health of the bright moon in Qin Dynasty】
List of articles
Preface
As a front-end development , install MySQL Is one of the most basic skills .
One 、 Get installation package
https://downloads.mysql.com/archives/community/
mysql-5.6.51-linux-glibc2.12-x86_64.tar.gz
Two 、 install
1. Unzip the installation package
Installation position 
tar -zxvf mysql-5.6.51-linux-glibc2.12-x86_64.tar.gz

mv mysql-5.6.51-linux-glibc2.12-x86_64 mysql
2. Add system mysql Group and mysql user
groupadd mysql
useradd -r -g mysql mysql

3. Create and modify mysql Data directory
Check whether the data directory exists , Namely myql Is there under the directory data Catalog

The above figure shows data Catalog , No need to create
perform vim /etc/my.cnf modify mysql Data directory 
4. Modify directory permissions
chown -R mysql:mysql ./

5. Initialize database
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data


Seeing the above output indicates that the database is initialized successfully
6. Modify the authority to root
chown -R root:root .
chown -R mysql:mysql data
7. Add startup service
cp support-files/mysql.server /etc/init.d/mysql

Start the service :service mysql start
You can see that the boot failed , According to the error message , Log directory has no permission to create , Manually create the log directory :mariadb

create a file :mariadb.log
Continue to start 
According to the prompt, it is UNIX socket file non-existent , This file should be created automatically , Suspect that the directory does not exist , Check and find no /var/lib/mysql Catalog , Create it 
Continue to start 
The discovery was successful
8. Sign in mysql

here root The user login mysql There is no need to enter a password , If you want to set the password , Keep looking down
9. Set up root User password
UPDATE user SET Password=PASSWORD(‘ Replace with your own password ’) where USER=‘root’;
FLUSH PRIVILEGES;
Log in again 
It is found that the password is not entered , Login denied . Check the settings just now mysql root User password .
summary
Original installation mysql Is not complicated , It will be more perfect if you can write this installation process into an automated script when you have time .
Reference documents
https://www.cnblogs.com/xinjing-jingxin/p/8025805.html
https://iwww.me/240.html
边栏推荐
- Virtualenv and pipenv installation
- When requesting resttemplate, set the request header, request parameters, and request body.
- Tensorrt command line program
- apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
- 20201025 visual studio2019 qt5.14 use of signal and slot functions
- Alibaba cloud MFA binding Chrome browser
- 提高用户体验 防御性编程
- Codeforces Round #797 (Div. 3) A—E
- (the 100th blog) written at the end of the second year of doctor's degree -20200818
- pytest(3)parametrize参数化
猜你喜欢

Linked list (linear structure)

Idea announced a new default UI, which is too refreshing (including the application link)

20201002 vs 2019 qt5.14 developed program packaging

代码技巧——Controller参数注解@RequestParam

广告业务Bug复盘总结

Redis——缓存击穿、穿透、雪崩

Redis - cluster data distribution algorithm & hash slot

Distributed transactions: the final consistency scheme of reliable messages

Detailed definition of tensorrt data format

Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
随机推荐
unittest. Texttestrunner does not generate TXT test reports
AWD学习
Functions of tensorrt
There is no way to drag the win10 desktop icon (you can select it, open it, delete it, create it, etc., but you can't drag it)
pytest(2) mark功能
js中map和forEach的用法
【文献阅读与想法笔记13】 Unprocessing Images for Learned Raw Denoising
(第一百篇BLOG)写于博士二年级结束-20200818
提高用户体验 防御性编程
ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
CTF web practice competition
JS modification element attribute flipping commonly used in selenium's Web Automation
Self cultivation of programmers - Reflection on job hunting
Fe - wechat applet - Bluetooth ble development research and use
AtCoder Beginner Contest 253 F - Operations on a Matrix // 树状数组
由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决
实现strStr() II
代码技巧——Controller参数注解@RequestParam
Learn about various joins in SQL and their differences
Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *