大家好,拜托我是 bash 脚本的新手,我的 bash 脚本在连接到 mysql 服务器以获取信息时遇到了一些挑战。这是我的脚本:
#! /bin/bash
MYSQL_USER="root"
MYSQL_PASSWORD="bibson13"
MYSQL_DATABASE="fredhosting"
MYSQL="/usr/bin/mysql –u$MYSQL_USER –p$MYSQL_PASSWORD -D$MYSQL_DATABASE"
$MYSQL -ss -e "select name,email,username,password from free_users where id_user=( select max(id_user) from free_users )"
但是当我尝试运行它时,我不断得到这个:
/usr/bin/mysql Ver 14.14 Distrib 5.5.28, for debian-linux-gnu (i686) using readline 6.2
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Usage: /usr/bin/mysql [OPTIONS] [database]
请我真的不知道做错了什么。如果有人能帮助我提供一些关于该做什么的信息,我将不胜感激,谢谢。