能一鍵轉存百度網盤檔案嗎?阿里雲「Teambition 網盤」:正在琢磨,希望提供合理的解決方案
阿新 • • 發佈:2020-10-08
配置mysql資料庫
登入mysql資料庫中
資料庫的基本管理
檢視資料庫
mysql>show databases;
切換登入資料庫mysql中
use mysql;
建立資料庫benet
create database benet;
檢視建立的資料庫
show databases;
刪除建立的資料庫accp
drop database accp;
表的基本管理
建立表
mysql> create tablebenet.student (姓名char(10),性別char(3),成績 int,身份證號碼char(16),primarykey (身份證號碼)); 建立表
檢視資料庫中的表
show tables; 檢視建立的表
檢視student表的結構
desc benet.student
刪除表
drop table benet.student;
表記錄管理
插入資料
mysql>insertintobenet.studentvalues(‘bob’,‘男’,‘100’,‘1234567891234567’);
查看錶中內容
mysql>select * from benet.student;
檢視姓名和成績列
mysql> select 姓名,性別 from benet.student;
修改指定身份證號碼的性別為女
mysql> select * from benet.student; 查看錶中內容
刪除指定表記錄和所有表記錄
先建立三個記錄
刪除指定的bob記錄
mysql> delete from benet.student where 姓名=‘bob’;
驗證
一次刪除所有記錄
mysql> delete from benet.student
驗證
資料庫的許可權管理
all 完全控制權限 select 允許查詢 insert 允許插入 update修改 delete刪除
mysql>grant all on benet.to’bob’@‘localhost’identified by’[email protected]’
檢視授權許可權
mysql>show grants for ‘bob’@’localhost’;
使用bob登入資料庫驗證許可權
在bob上檢視benet.student表中內容
撤銷許可權
mysql> revoke all on benet. from ‘bob’@‘localhost’;
配置遠端主機登入mysql伺服器
系統盤安裝mysql客戶端
yum -y install mysql
使用管理員授權登入許可權
mysql>grant select on . to ‘root’@‘192.168.100.20’ identified by ‘[email protected]’;
客戶端登入驗證
[[email protected]~]# mysql -h 192.168.100.10 -u root [email protected] -P 3306