久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      MariaDB 常用命令匯總

      MySQL數(shù)據(jù)庫項目自從被Oracle公司收購之后,從開源軟件轉(zhuǎn)變成為了“閉源”軟件,這導(dǎo)致IT行業(yè)中的很多企業(yè)以及廠商紛紛選擇使用了數(shù)據(jù)庫軟件的后起之秀—MariaDB數(shù)據(jù)庫管理系統(tǒng)。MariaDB數(shù)據(jù)庫管理系統(tǒng)也因此快速占據(jù)了市場。

      列舉一些常用的命令,方便對數(shù)據(jù)庫進行管理。相關(guān)介紹參考于:https://www.linuxprobe.com/chapter-18.html#182_mariaDB

      PS:MariaDB命令不區(qū)分大小寫。

      mariaDB服務(wù)安裝與初始化

        [root@linuxprobe ~]# yum install mariadb mariadb-server  # 安裝  [root@linuxprobe ~]# mysql_secure_installation            #初始化

      添加防火墻策略

        [root@linuxprobe ~]# firewall-cmd --permanent --add-service=mysql    #加入防火墻,名字mysql 永久有效  [root@linuxprobe ~]# firewall-cmd --reload                            #立即生效

      登錄數(shù)據(jù)庫

        [root@linuxprobe ~]# mysql -u root -p  #u參數(shù)用來指定以root管理員的身份登錄,-p參數(shù)用來驗證該用戶在數(shù)據(jù)庫中的密碼值  

      數(shù)據(jù)庫基本命令

        MariaDB [(none)]> SHOW databases;    #查看當前都有哪些數(shù)據(jù)庫  MariaDB [(none)]> use mysql          #進入mysql數(shù)據(jù)庫  MariaDB [mysql]> SHOW TABLES;        #看表單user  MariaDB [mysql]> exit                #退出mysql數(shù)據(jù)庫  

      用戶管理

        MariaDB [(none)]> SET password = PASSWORD('linuxprobe'); #修改當前數(shù)據(jù)庫用戶密碼  MariaDB [(none)]> CREATE USER luke@localhost IDENTIFIED BY 'linuxprobe'; #創(chuàng)建用戶 luke 指定密碼 linuxprobe  MariaDB [mysql]> GRANT SELECT,UPDATE,DELETE,INSERT ON mysql.user TO luke@localhost; #針對mysql數(shù)據(jù)庫中的user表單向賬戶luke授予查詢、更新、刪除以及插入等權(quán)限  MariaDB [(none)]> REVOKE SELECT,UPDATE,DELETE,INSERT ON mysql.user FROM luke@localhost; #移除剛才的授權(quán)  MariaDB [(none)]> SHOW GRANTS FOR luke@localhost;  #查看一下賬戶luke的權(quán)限

      數(shù)據(jù)庫的創(chuàng)建與刪除

        MariaDB [(none)]> CREATE DATABASE linuxprobe; #創(chuàng)建數(shù)據(jù)庫 linuxprobe  MariaDB [(none)]> DROP DATABASE linuxprobe;       #刪除數(shù)據(jù)庫

      表單的創(chuàng)建及相關(guān)操作

        MariaDB [linuxprobe]> CREATE TABLE mybook (name char(15),price int,pages int); #創(chuàng)建數(shù)據(jù)表單,然后進行表單的初始化  MariaDB [linuxprobe]> DESCRIBE mybook;      #描述表單  MariaDB [linuxprobe]> INSERT INTO mybook(name,price,pages) VALUES('linuxprobe','60','518'); #向表單中插入一條記錄  MariaDB [linuxprobe]> UPDATE mybook SET price=55 ; #更新表單記錄  MariaDB [linuxprobe]> SELECT name,price FROM mybook;  #按照字段查詢表單  MariaDB [linuxprobe]> SELECT * FROM mybook;          #查詢表單全部內(nèi)容  MariaDB [linuxprobe]> SELECT * FROM mybook WHERE price>75;    #where條件匹配查詢price>75的記錄  MariaDB [linuxprobe]> DELETE FROM mybook;            #清空表單內(nèi)容  

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號