在bash中从mysql读取多行时出错

时间:2016-09-20 04:58:30

标签: mysql bash shell

看看Internet上的方法从bash中的mysql db读取多行我正在做以下事情:

@media (max-width:768px) {
.navbar-default .navbar-collapse {
border: none;
box-shadow: none;
}

.navbar-default .navbar-collapse {
 background: #eeeeee;
 position: absolute;
 width:100%;
 top: 40px;
}
}

但不幸的是我收到了以下错误:

i=0
while read relation_id
do
  echo "Record $(( i++ )) $relation_id"
done < <(mysql -u$db_user -p$db_password -h$db_host -D$db_name -se "SELECT id where connection_id=$id")

请帮助我知道我做错了什么。

1 个答案:

答案 0 :(得分:0)

删除空间已完成&lt; &lt;(mysql 此处。它应该是&lt;&lt; not&lt;&lt;