当前位置:网站首页>Basic management of mysql database in Linux system
Basic management of mysql database in Linux system
2022-08-02 17:31:00 【linyxg】
MariaDB basic information
- Start service: systemctl start mariadb
- Default port number: 3306
- Main configuration file: vim /etc/my.cnf.d/mariadb-server.cnf
- Data directory: /var/lib/mysql (you need to clean this directory and backup when you need to reinstall mariadb)
- Service startup script: /usr/lib/system/mariadb.service
Installation of MariaDB database
MariaDB database management system is a fork of MySql which is designed to be fully compatible with MySql, including API and command line.
- Install the database: dnf install mariadb-server.x86_64

- View the file of the mariadb installation package: rpm -ql mariadb-server

- Enable database: systemctl enable --now mariadb
li>
Safe initialization of database
- For the database that has just been installed, you need to set the database password first
- Initialization script: mysql_secure_installation


- Log in to the database: mysql -uusername -ppassword

- Close the open port of the database
- View the data port number: netstat -antlupe | grep mysql
By default, the database opens the port to the outside world
- Edit the configuration file and close the port: vim /etc/my.cnf.d/mariadb-server.cnf

- Restart the mariadb service: systemctl restart mariadb.service
Basic management of the database
- Part of the basic syntax

Database Password Management
- Database password change: mysqladmin -uroot -pwestos password redhat

- Database password cracking
Close the database: systemctl stop mariadb
Skip the authorization table to run the database: mysqld_safe --skip-grant-tables &
Log in to the database: mysql -uroot -pwestos
View aboutmysql process: ps -aux |grep mysql
Kill process: kill -9 process number
New password login: mysql -uroot -plyx
User Management
New User

Ordinary user authorization
Super user login database: mysql -uroot -pwestos
Test if authorization is successful

Cancel authorization: revoke insert on database_name.* from [email protected]

Database Backup and Restore
- Database Backup

- Database Restoration

- Restore successfully

边栏推荐
猜你喜欢

两分钟录音就可秒变语言通!火山语音音色复刻技术如何修炼而成?

【 Leetcode string, the string transform/hexadecimal conversion 】 HJ1. The length of the string last word HJ2. Calculation of a certain number of characters appear HJ30. String merging processing

容器中的Cgroup

中科驭数等单位牵头发布行业首部DPU评测方法技术白皮书

Based on mobileNet dog breed classification (migration)

该死的单元测试,写起来到底有多痛?

DC-DC选型及电路设计

TMS320C6678开发板( DSP+Zynq )RTOS综合功能案例,嵌入式必看!

phpstudy实现命令行操作

aPaaS低代码平台(二) | 快速构建业务模型
随机推荐
PAT Class A 1130 Infix Expressions
遍历堆 PAT甲级 1155 堆路径
【Untitled】
如何查看微信小程序服务器域名并且修改
容器中的Cgroup
mysql 索引使用与优化
vite.config.ts introduces the `path` module Note!
IDO预售DAPP系统开发(NFT挖矿)
SSRF(服务器端请求伪造)
PAT serie a 1137 final grades
已解决ModuleNotFoundError: No module named‘ pip‘(重新安装pip的两种方式)
中国服装行业已形成一套完整的产业体系
Qt | 关于容器类的一些总结
兆骑科创创业赛事活动路演,高层次人才引进平台
虚拟现实处理器(SXR2130P)ISO7640FMDW(数字隔离器)说明
Qt | 关于对象树和元对象的相关问题
leetcode 504. Base 7 七进制数 (简单)
中科驭数等单位牵头发布行业首部DPU评测方法技术白皮书
【知乎高赞】为什么很多资质平庸的女人嫁得很好,很多优质女性却成了剩女?
form的编辑与展示的切换(输入框,单选多选框,上传图片,颜色选择器)适用个人信息的展示与修改