久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    1. <small id='PdwUM'></small><noframes id='PdwUM'>

      <i id='PdwUM'><tr id='PdwUM'><dt id='PdwUM'><q id='PdwUM'><span id='PdwUM'><b id='PdwUM'><form id='PdwUM'><ins id='PdwUM'></ins><ul id='PdwUM'></ul><sub id='PdwUM'></sub></form><legend id='PdwUM'></legend><bdo id='PdwUM'><pre id='PdwUM'><center id='PdwUM'></center></pre></bdo></b><th id='PdwUM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PdwUM'><tfoot id='PdwUM'></tfoot><dl id='PdwUM'><fieldset id='PdwUM'></fieldset></dl></div>

      <legend id='PdwUM'><style id='PdwUM'><dir id='PdwUM'><q id='PdwUM'></q></dir></style></legend>

    2. <tfoot id='PdwUM'></tfoot>
      • <bdo id='PdwUM'></bdo><ul id='PdwUM'></ul>

      如何在 MySQL 中可靠地刪除和創(chuàng)建數(shù)據(jù)庫(kù)和用戶

      How Can I Reliably Drop and Create a Database and a User in MySQL(如何在 MySQL 中可靠地刪除和創(chuàng)建數(shù)據(jù)庫(kù)和用戶)
          <tbody id='QrBK0'></tbody>
          1. <i id='QrBK0'><tr id='QrBK0'><dt id='QrBK0'><q id='QrBK0'><span id='QrBK0'><b id='QrBK0'><form id='QrBK0'><ins id='QrBK0'></ins><ul id='QrBK0'></ul><sub id='QrBK0'></sub></form><legend id='QrBK0'></legend><bdo id='QrBK0'><pre id='QrBK0'><center id='QrBK0'></center></pre></bdo></b><th id='QrBK0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QrBK0'><tfoot id='QrBK0'></tfoot><dl id='QrBK0'><fieldset id='QrBK0'></fieldset></dl></div>

            • <bdo id='QrBK0'></bdo><ul id='QrBK0'></ul>
            • <tfoot id='QrBK0'></tfoot>
                <legend id='QrBK0'><style id='QrBK0'><dir id='QrBK0'><q id='QrBK0'></q></dir></style></legend>
              • <small id='QrBK0'></small><noframes id='QrBK0'>

                本文介紹了如何在 MySQL 中可靠地刪除和創(chuàng)建數(shù)據(jù)庫(kù)和用戶的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我目前正在運(yùn)行兩個(gè)腳本.

                I am currently running two scripts.

                01_INIT_DATABASE.SQL

                CREATE DATABASE foobar;
                USE foobar;
                CREATE USER 'foo'@'localhost' IDENTIFIED BY 'bar';
                GRANT ALL PRIVILEGES ON foobar.* TO 'foo'@'localhost' WITH GRANT OPTION;
                CREATE USER 'foo'@'%' IDENTIFIED BY 'bar';
                GRANT ALL PRIVILEGES ON foobar.* TO 'foo'@'%' WITH GRANT OPTION;
                

                01_DROP_DATABASE.SQL

                USE foobar
                DROP USER 'foo'@'localhost';
                DROP USER 'foo'@'%';
                DROP DATABASE IF EXISTS foobar;
                

                如果一個(gè)或另一個(gè)運(yùn)行不正常,它們都會(huì)有選擇地失敗.

                They each selectively fail if one or the other has not run properly.

                我怎樣才能讓它們可靠地運(yùn)行(或者優(yōu)雅地失敗,例如,只刪除存在的用戶)

                How can I get them to run reliably (or fail gracefully, for example, to only drop a user if it exists)

                我正在通過(guò)一個(gè) ant 任務(wù)運(yùn)行它們(如果這會(huì)影響事情,但它實(shí)際上只是一個(gè) Java Exec),形式為

                I am running them through an ant task (if that affects things, but it is really just a Java Exec), in the form of

                <exec executable="mysql" input="./src/main/ddl/create/01_init_database.sql">
                  <arg value="-uroot"/>
                  <arg value="-ptoor"/>
                </exec>
                

                我的 MySQL 版本是

                My MySQL Version is

                mysql  Ver 14.14 Distrib 5.5.52, for debian-linux-gnu (x86_64) using readline 6.2
                

                更新IF EXISTS 和 IF NOT EXISTS 對(duì)用戶不起作用.它適用于 DATABASE.

                Update IF EXISTS and IF NOT EXISTS does not work for USER. It works fine for DATABASE.

                ERROR 1064 (42000):您的 SQL 語(yǔ)法有錯(cuò)誤;檢查與您的 MySQL 服務(wù)器版本相對(duì)應(yīng)的手冊(cè),了解在第 1 行 'IF NOT EXISTS 'foo'@'localhost' IDENTIFIED BY 'bar'' 附近使用的正確語(yǔ)法

                ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS 'foo'@'localhost' IDENTIFIED BY 'bar'' at line 1

                ERROR 1064 (42000):您的 SQL 語(yǔ)法有錯(cuò)誤;檢查與您的 MySQL 服務(wù)器版本相對(duì)應(yīng)的手冊(cè),了解在第 1 行的 'IF EXISTS 'foo'@'%'' 附近使用的正確語(yǔ)法

                ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS 'foo'@'%'' at line 1

                推薦答案

                您可以將 IF NOT EXISTS 添加到您的數(shù)據(jù)庫(kù)架構(gòu)和用戶創(chuàng)建中:例如:

                You can add IF NOT EXISTS to your databasechema and user creation: like:

                CREATE DATABASE IF NOT EXISTS foobar;
                CREATE USER IF NOT EXISTS 'foo'@'localhost' IDENTIFIED BY 'bar';
                GRANT ALL PRIVILEGES ON foobar.* TO 'foo'@'localhost' WITH GRANT OPTION;
                CREATE USER  IF NOT EXISTS 'foo'@'%' IDENTIFIED BY 'bar';
                GRANT ALL PRIVILEGES ON foobar.* TO 'foo'@'%' WITH GRANT OPTION;
                

                以及掉落:

                DROP USER IF EXISTS 'foo'@'localhost';
                DROP USER IF EXISTS  'foo'@'%';
                DROP DATABASE IF EXISTS foobar;
                

                如下所述:如果用戶不存在,則僅適用于 mysql 5.7 及更高版本.不要使用5.7以下的create user語(yǔ)法,而是將grant語(yǔ)句改為:

                As mentioned below: the user if not exists only works on mysql 5.7 and higher. Do not use the create user syntax below 5.7, but change the grant statement to:

                GRANT ALL PRIVILEGES ON foobar.* TO 'foo'@'localhost' identified by 'password' WITH GRANT OPTION;
                

                這篇關(guān)于如何在 MySQL 中可靠地刪除和創(chuàng)建數(shù)據(jù)庫(kù)和用戶的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數(shù)根據(jù) N 個(gè)先前值來(lái)決定接下來(lái)的 N 個(gè)行)
                reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達(dá)式的結(jié)果;條款?)
                Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數(shù)的 ignore 選項(xiàng)是忽略整個(gè)事務(wù)還是只是有問(wèn)題的行?) - IT屋-程序員軟件開發(fā)技
                Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時(shí)出錯(cuò),使用 for 循環(huán)數(shù)組)
                pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調(diào)用 o23.load 時(shí)發(fā)生錯(cuò)誤 沒(méi)有合適的驅(qū)動(dòng)程序)
                How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數(shù)據(jù)庫(kù)表作為 Spark 數(shù)據(jù)幀讀取?)

                1. <legend id='UZFcE'><style id='UZFcE'><dir id='UZFcE'><q id='UZFcE'></q></dir></style></legend>
                    <tfoot id='UZFcE'></tfoot>

                        <small id='UZFcE'></small><noframes id='UZFcE'>

                        • <bdo id='UZFcE'></bdo><ul id='UZFcE'></ul>
                        • <i id='UZFcE'><tr id='UZFcE'><dt id='UZFcE'><q id='UZFcE'><span id='UZFcE'><b id='UZFcE'><form id='UZFcE'><ins id='UZFcE'></ins><ul id='UZFcE'></ul><sub id='UZFcE'></sub></form><legend id='UZFcE'></legend><bdo id='UZFcE'><pre id='UZFcE'><center id='UZFcE'></center></pre></bdo></b><th id='UZFcE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UZFcE'><tfoot id='UZFcE'></tfoot><dl id='UZFcE'><fieldset id='UZFcE'></fieldset></dl></div>

                            <tbody id='UZFcE'></tbody>
                          主站蜘蛛池模板: 婷婷成人在线 | 91在线看| 国产在线1 | 黄色日批视频 | 91精品国产日韩91久久久久久 | 玖玖在线免费视频 | 免费国产黄网站在线观看视频 | 国产亚洲久 | 欧美精选一区二区 | 午夜婷婷激情 | 国产精品久久久久久av公交车 | 天天操天天摸天天爽 | 波多野结衣一区二区三区在线观看 | 国产福利观看 | 国产精品久久久久久久岛一牛影视 | 免费一级淫片aaa片毛片a级 | 国产亚洲精品久久久优势 | 黄色在线免费观看视频 | 日本特黄a级高清免费大片 国产精品久久性 | 午夜影院在线观看 | 天天操天天插天天干 | 超碰成人免费观看 | 日韩成人在线免费观看 | 国产一级在线观看 | 国产精品国产精品国产专区不蜜 | 亚洲欧美中文日韩在线v日本 | 尹人av | www.4虎影院 国产999精品久久久影片官网 | 久久久久无码国产精品一区 | 成人免费视频在线观看 | 99久久精品视频免费 | 人人干人人草 | 国产日韩在线观看一区 | 国产色| 欧美在线一区二区视频 | 久久高清| 久久综合狠狠综合久久综合88 | 中文字幕在线观看视频网站 | 中文字幕亚洲欧美日韩在线不卡 | 成人精品系列 | 欧美特级黄色 |