1
我有一個MySQL表看起來是這樣的:MySQL的更新表從文件中包含主鍵
----------------------
| ID | Status |
----------------------
| 0 | not ready |
| 1 | not ready |
| 2 | not ready |
| 3 | not ready |
| 4 | not ready |
| 5 | not ready |
| ... | not ready |
----------------------
和含ID的列表,看起來像這樣的文件:
0
1
13
24
133
...
我想在此表中將Status
設置爲ready
。有沒有辦法從bash腳本做到這一點?最好在一次登錄會話中。例如我不想做這樣的事情:
for line in file:
mysql --user="me" --password="mypass" --database="db" --execute="exec this line"
這將需要登錄我在每行改變