運維第四次作業

2021-10-06 20:18:29 字數 1396 閱讀 9393

建立乙個 maria db 資料庫,名為 contacts

資料庫查詢

密碼是fadora 的人的名字是什麼?

有多少人的姓名是 john ,同時居住在 santa clara

資料庫備份

建立乙個 maria db 資料庫,名為 contacts

要求:將users.mdb匯入到資料庫 ,資料庫只能被 localhost 訪問。

除了 root 使用者,此資料庫只能被使用者 mary 查詢,此使用者密碼為 redhat

登入 mariadb資料庫,建立名為contacts資料庫

// create database if not exists contacts;

// show databases;

可以看出已經建立完成

將users.mdb匯入到資料庫

// source /test/users.mdb;

使用者及許可權修改

// create user mary@localhost identified by 『redhat』; # 建立使用者mary

// grant select on contacts.* to mary@localhost; # 提權

2. 資料庫查詢

在 system1 上使用資料庫 contacts ,並使用相應的 sql 查詢以回答下列問題:

密碼是fadora 的人的名字是什麼?

// select * from u_name left join u_passwd on u_name.userid=u_passwd.uid where password=「fadora」;

2 有多少人的姓名是 john ,同時居住在 santa clara

// select * from u_name where userid in (select uid from u_loc where location like 「santa clara」) and firstname=「john」;

// select * from u_name left join u_loc on u_name.userid=u_loc.uid where location=「santa clara」 and firstname=「john」; # 左連線法

資料庫備份

使用mysqldump備份資料庫contacts,備份時壓縮,檔名:contacts_年-月-日.sql.gz

以下操作在命令列執行

// mysqldump -uroot -p123 -b contacts > /test/contacts.sql | gzip -c contacts.sql > /test/contacts_2020-6-4.sql.gz

第四次作業

扎ogu 典型產品 最高傳輸速率 ieee 802.11a wi fi5 802.11a 43m 450 zyxel p334u 54mbps 1500 zyxel p335u 54mbps 1600 ieee 802.11b d link di 624 a 54mbps 215 linksys w...

第四次作業

作業題一 vs2012 rc在介面上,比beta版更容易使用,彩色的圖示和按照開發 執行 除錯等環境區分的顏色方案讓人愛不釋手。vs2012整合了asp.net mvc 4,全面支援移動和html5,wf 4.5相比wf 4,更加成熟,期待已久的狀態極工作流回來了,更棒的是,現在它的設計器已經支援c...

第四次作業

專案一求1000以內所有偶數的和 includevoid main cout sum includevoid main while i 1000 cout sum includeint main while i 1001 cout 專案3 乘法口訣表 程式設計序,輸出乙個乘法口訣表,形如 1x1 1...