当前位置:网站首页>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
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 -pwestosTest if authorization is successful
Cancel authorization: revoke insert on database_name.* from [email protected]
Database Backup and Restore
- Database Backup
- Database Restoration
- Restore successfully
边栏推荐
猜你喜欢
随机推荐
PostGresql listen与notify命令
初入c语言
Servlet基础详解
QT | VS2017 + Qt5.14.2 环境搭建
codeforces Linova and Kingdom
【Leetcode字符串--字符串变换/进制的转换】HJ1.字符串最后一个单词的长度 HJ2.计算某字符出现次数 HJ30.字符串合并处理
c语言实现三子棋
中科驭数等单位牵头发布行业首部DPU评测方法技术白皮书
矩阵的特征值与特征向量
阿里面试败北:5种微服务注册中心如何选型?这几个维度告诉你
PAT serie a 1137 final grades
c语言实现排雷
A status code, and access baidu process
中国服装行业已形成一套完整的产业体系
状态码以及访问百度过程
Mechanical keyboard failure
系统存储的基本管理--挂载,分区,用户配额
PAT甲级 1143 最低公共祖先
MySQL 行级锁(行锁、临键锁、间隙锁)
Qt | 控件之 QCheckBox