当前位置:网站首页>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
边栏推荐
- Sentinel规则持久化到Nacos
- 分布式事务 :可靠消息最终一致性方案
- Loops in tensorrt
- Find the highest value of the current element Z-index of the page
- AWD学习
- Error "list" object is not callable in Web automatic switching window
- Learn about various joins in SQL and their differences
- qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
- Sentinel Alibaba open source traffic protection component
- 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)

Apt command reports certificate error certificate verification failed: the certificate is not trusted

蚂蚁集团g6初探

ctf-web之练习赛

20201002 VS 2019 QT5.14 开发的程序打包

Latex在VSCODE中编译中文,使用中文路径问题解决

Detailed definition of tensorrt data format

js中正则表达式的使用

实习生跑路留了一个大坑,搞出2个线上问题,我被坑惨了

IDEA公布全新默认UI,太清爽了(内含申请链接)
随机推荐
Distributed transactions: the final consistency scheme of reliable messages
Error "list" object is not callable in Web automatic switching window
selenium+msedgedriver+edge浏览器安装驱动的坑
After reading useful blogs
Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved
web自动化切换窗口时报错“list“ object is not callable
CUDA中的动态全局内存分配和操作
构建学习tensorflow
Introduce two automatic code generators to help improve work efficiency
Sparse array (nonlinear structure)
20210306转载如何使TextEdit有背景图片
No process runs when querying GPU, but the video memory is occupied
CUDA用户对象
sprintf_s的使用方法
CTF web practice competition
Latex 编译报错 I found no \bibstyle & \bibdata & \citation command
CUDA中的Warp Shuffle
JS modification element attribute flipping commonly used in selenium's Web Automation
Redis - grande question clé
ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package