<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 命令行操作Mysql的常用命令-查詢 >[success]熟練掌握命令行操作Mysql是十分必要的。 ## 1. 連接MYSQL ~~~ mysql -uroot -p ~~~ ## 2. 查看數據庫列表 ~~~ show databases; ~~~ ![](https://box.kancloud.cn/2512467ad398bd6cd909700fa290a646_348x280.png) ## 3. 選擇數據庫 ~~~ use 要操作的數據庫名稱; ~~~ ## 4. 查看當前數據庫中的表 ~~~ show tables; ~~~ ![](https://box.kancloud.cn/398c8464ff2c1fbe3723bee0899f6f4d_425x348.png) ## 5. 查看表結構 ~~~ desc 要查看的表名; ~~~ ![](https://box.kancloud.cn/ee91ce93df791f463dfd946c98a61a7c_928x539.png) ## 6. 查詢表中列的注釋信息 ~~~ select * from information_schema.columns where table_schema = 'db' #表所在數據庫 and table_name = 'tablename' ; #你要查的表 ~~~ ## 7.只查詢列名和注釋 ~~~ select column_name, column_comment from information_schema.columns where table_schema ='db' and table_name = 'tablename' ; ~~~ ## 8.查看表的注釋 ~~~ select table_name,table_comment from information_schema.tables where table_schema = 'db' and table_name ='tablename' ~~~ ## 創建索引 方法一:使用ALTER TABLE語句創建索引 ~~~ alter table table_name add index index_name (column_list) ; alter table table_name add unique (column_list) ; alter table table_name add primary key (column_list) ; ~~~ 方法二:使用CREATE INDEX語句對表增加索引 ~~~ create index index_name on table_name (column_list) ; create unique index index_name on table_name (column_list) ; ~~~ ## 10.刪除索引 ~~~ drop index index_name on table_name ; alter table table_name drop index index_name ; alter table table_name drop primary key ; ~~~ ## 11.判斷數據表在數據庫是否存在 ~~~ SHOW TABLES LIKE 'by_currency' ; //或 drop table 'by_currency' if exists 'by_currency' ; ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看