当前位置:网站首页>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
边栏推荐
- Pytest (2) mark function
- Name six schemes to realize delayed messages at one go
- 自学table au
- TensorRT的数据格式定义详解
- Three suggestions for all students who have graduated and will graduate
- 查询GPU时无进程运行,但是显存却被占用了
- Code skills - Controller Parameter annotation @requestparam
- Redis——缓存击穿、穿透、雪崩
- selenium的web自动化中常用的js-修改元素属性翻页
- There are multiple good constructors and room will problem
猜你喜欢

ShardingSphere-JDBC篇

Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *

实现strStr() II

华为MindSpore开源实习机试题

Fe - wechat applet - Bluetooth ble development research and use

Solution to the black screen of win computer screenshot

CUDA中的Warp Shuffle

阿里云MFA绑定Chrome浏览器

FE - 微信小程序 - 蓝牙 BLE 开发调研与使用

Redis——Cluster数据分布算法&哈希槽
随机推荐
IDEA公布全新默认UI,太清爽了(内含申请链接)
selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
unittest. Texttestrunner does not generate TXT test reports
kali最新更新指南
由於不正常斷電導致的unexpected inconsistency;RUN fsck MANUALLY問題已解决
Warp shuffle in CUDA
压力测试修改解决方案
Blog directory of zzq -- updated on 20210601
Thread hierarchy in CUDA
Tensorrt command line program
automation - Jenkins pipline 执行 nodejs 命令时,提示 node: command not found
NodeJs - Express 中间件修改 Header: TypeError [ERR_INVALID_CHAR]: Invalid character in header content
2020-9-23 use of QT timer qtimer class.
奇葩pip install
CUDA and Direct3D consistency
Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *
CTF web practice competition
PgSQL学习笔记
CUDA与Direct3D 一致性
Flask-Migrate 检测不到db.string() 等长度变化