鍍金池/ 問答/ 數(shù)據(jù)庫問答
替身 回答

這就涉及到事物的隔離級(jí)別了.隔離級(jí)別越高,越能保證數(shù)據(jù)的完整性和一致性,但是對并發(fā)性能的影響也越大

事務(wù)隔離級(jí)別                    臟讀     不可重復(fù)讀    幻讀
讀未提交(read-uncommitted)    是        是            是
不可重復(fù)讀(read-committed)    否        是            是
可重復(fù)讀(repeatable-read)     否        否            是
串行化(serializable)          否        否            否

落殤 回答

既然是同樣的數(shù)據(jù)在添加的時(shí)候?yàn)槭裁床?update 前面邏輯刪除的數(shù)據(jù)呢?

擱淺 回答

?,為什么總有人把這種update/set語法都搞錯(cuò),update table set A=X,B=X where ..; 不是什么set A=X and B=X .. 這里的on duplicate key update后面也是一樣。。。 不能用and。。。

痞性 回答

Linux上用第二種方法報(bào)錯(cuò),還是window上用第一種方法報(bào)錯(cuò)?
不然你怎么知道不統(tǒng)一

陌南塵 回答
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <style>
        .circle {
            width: 100px;
            height: 100px;
            border: 20px solid #000;
            border-radius: 50%;
            border-left-color: transparent;
            border-top-color: transparent;
            transform: rotate(-45deg);
        }
    </style>
</head>
<body>
<div class="circle"></div>
</body>
</html>

這個(gè)半圓用SVG寫的話也是挺簡單的。

你好胸 回答

mongoosefind有回調(diào)啊,或者promise寫法。 查到結(jié)果了,在回調(diào)里實(shí)現(xiàn)業(yè)務(wù)邏輯就可以了啊。
參考文檔

念初 回答

proxyTable改動(dòng)一下:

 dev: {
    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {
         // 去掉這個(gè)注釋
      '/admin': {
        target: 'http://localhost:8004',
        changeOrigin: true
      }
    },

    // Various Dev Server settings
    host: 'localhost', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-

    
    /**
     * Source Maps
     */

    // https://webpack.js.org/configuration/devtool/#development
    devtool: 'cheap-module-eval-source-map',

    // If you have problems debugging vue-files in devtools,
    // set this to false - it *may* help
    // https://vue-loader.vuejs.org/en/options.html#cachebusting
    cacheBusting: true,

    cssSourceMap: true
  },
柒喵 回答

id是主鍵,單查id會(huì)用到主鍵唯一索引,而且查1列跟查多列的速度肯定是不一樣的

荒城 回答

mongodb服務(wù)器還需要在啟動(dòng)時(shí)加一個(gè)auth參數(shù),文檔中這樣寫

Run the database (mongod process) with the --auth option to enable security. You must either have added a user to the admin db before starting the server with --auth, or add the first user from the localhost interface.

我也覺得這個(gè)設(shè)計(jì)很奇怪,為啥不直接缺省帶上呢。

笨尐豬 回答

如果是遠(yuǎn)程登陸,有可能遠(yuǎn)程主機(jī)被禁止訪問。本地登陸說明密碼確實(shí)錯(cuò)了

舊酒館 回答

beego初始化的時(shí)候開三個(gè)數(shù)據(jù)庫鏈接就行了,不建議用的時(shí)候再開

dataSourceName := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",user,passwd,addr,dbname)
db, err := sql.Open("mysql", dataSourceName)
把db保存起來。

動(dòng)態(tài)表名的話,只要知道你表名生成的規(guī)則,拼個(gè)sql來查詢就行了。

魚梓 回答

CREATE TEMPORARY TABLE temTB(

id int    PRIMARY KEY AUTO_INCREMENT,
   age INT UNSIGNED,
   job VARCHAR(50),
   marital VARCHAR(30),
   education VARCHAR(50),
   `default` VARCHAR(30),
   balance INT,
   housing VARCHAR(10),
   loan VARCHAR(10),
   contact varchar(30),
   `day` INT,
   `month` varchar(20),
   duration INT,
   campaign INT,
   pdays INT,
   previous INT,
   poutcome varchar(20),
   y varchar(20)

)

喜歡你 回答

基本信息,就是一個(gè)“比賽”,基本字段: id,主隊(duì),客隊(duì),結(jié)果。就完了啊,其它的東西,要么在上面加外鍵,比如什么國家,賽季,聯(lián)賽,要么通過計(jì)算可得。

然后,可以有一個(gè)現(xiàn)成的積分 Table ,不過事實(shí)上它里面的信息是冗余的而已,這個(gè)表刪了也沒事。

枕邊人 回答

頁面的鏈接應(yīng)該用絕對路徑,你這可能是相對路徑了,檢查檢查。javaweb類有相應(yīng)的方法

涼心人 回答

1,連接數(shù)據(jù)庫時(shí)使用charset='utf8';
2,sql語句使用unicode形式拼接,最后encode成utf-8;

離夢 回答

不要把角色與菜單數(shù)據(jù)對應(yīng)。應(yīng)該使用權(quán)限點(diǎn)的方式來做

表結(jié)構(gòu)大致如下:
角色表,存放角色名和角色權(quán)限點(diǎn)
菜單表,菜單呈現(xiàn)所需要的權(quán)限點(diǎn)

在后臺(tái)編程過程中只要檢查權(quán)限點(diǎn)即可

孤島 回答

沒有. 觸發(fā)器只有 INSERT, UPDATE 兩種.
提取使用函數(shù)來吧. Mysql有rand(), PHP也有rand()

默念 回答

要看服務(wù)器的硬盤空間了,如果被用完了,服務(wù)器就基本運(yùn)行不了了。
畢竟 linux 環(huán)境下一切都是文件,沒空間了,文件不能寫了,基本就掛了

葬愛 回答

如果改變文檔結(jié)構(gòu)是一種可接受的解決方案的話, 可以考慮把 property 改為數(shù)組:

{
    "_id" : ObjectId("5aaf36743e178f2e540cb6e9"),
    "property" : [
        { "key" : "test1_field_1", "value" : "acd" },
        { "key" : "test1_field_2", "value" : "3" },
        { "key" : "xxx_field", "value" : "hell" },
        { "key" : "field_unknown", "value" : "hello world" }
    ]
}

這樣就可以用 property.key 為字段進(jìn)行查詢了:

db.coll.find({"property.key":/a/})

mongo 同時(shí)也支持對數(shù)組進(jìn)行索引:
官方文檔 - multikey indexes

尋仙 回答

首先,你沒有代碼發(fā)出來,如果是代碼問題,那么就沒辦法分析。