cronjob命令行用SQL查询更新PHPmyAdmin数据库

In Bluehost under the cronjob task list I have set up a job that executes every minute.

mysql --user=myusername --password=mypassword use mydb 
       -e "UPDATE `users` SET val = '1' WHERE name = 'matt'"

I believe I am not selecting the database properly as I am using the same username and pass to log into PHPmyAdmin and the SQL query works fine once I have logged into PHPmyAdmin.

Where is the mistake?

the command line should be

mysql --user=myusername --password=mypassword -D mydb -e "UPDATE `users` SET val = '1' WHERE name = 'matt'"

the -D databasename parameter is what you are looking for

You may follow these steps:

$ mysql -u <username> -p <enter>
$ <password>
$> use mydb;
$> update user set val = 1 where name = matt;

from the command line