mariadb数据库配置
安装
205 yum install mariadb -y 206 yum install mariadb-server -y 207 systemctl restart mariadb 208 systemctl enable mariadb
初始化
mysql_secure_installation
查看数据库
show databases;
更改密码
MariaDB [(none)]> set password =password(‘linuxprobe‘);
创建账号
MariaDB [(none)]> create user identified by ‘linuxprobe‘;
添加权限
MariaDB [(none)]> grant select,update,delete,insert on mysql.* to ;
删除权限
MariaDB [(none)]> revoke select,update,delete,insert on mysql.* to ;
增删改查
新建数据库
create database linuxprobe;
使用数据库
use linuxprobe;
创建表格
create table mybook(name char(15),price int, pages int);
增
insert into mybook(name,price,pages) values(‘linuxprobe‘, ‘60‘, ‘400‘);
查
select * from mybook;
改
update mybook set price=40;
删
delete from mybook;
高级查
select * from mybook where name=‘linuxprobe‘; select name,price from mybook where name=‘linuxprobe‘; select * from mybook where price>‘50‘;
数据库备份
mysqldump -u root -p linuxprobe >dbbackup.dump
数据库恢复
mysql -u root -p linuxprobe < dbbackup.dump
相关推荐
Gexrior 2020-10-22
Lostinthewoods 2020-10-29
txt 2020-06-14
azhou 2020-06-12
hungzz 2020-06-11
CharlesYooSky 2020-06-05
aliuge 2020-06-03
URML 2020-05-30
lwwishes 2020-05-29
83173052 2020-05-29
muzirigel 2020-05-26
饮马天涯 2020-05-20
aliuge 2020-05-12
83173052 2020-05-10
Mrbianxin 2020-05-07
InJavaWeTrust 2020-05-04
hungzz 2020-04-23