即使在正确的目录中,mysql也不会在终端中运行?

时间:2017-01-24 21:13:39

标签: mysql terminal

我正在尝试在mac os x Sierra上运行mysql 5.7,但即使我在正确的目录中,程序也不会运行。这是终端:

➜  mysql-5.7.17-macos10.12-x86_64 cd bin
➜  bin ls
innochecksum               mysqlbinlog
lz4_decompress             mysqlcheck
my_print_defaults          mysqld
myisam_ftdump              mysqld-debug
myisamchk                  mysqld_multi
myisamlog                  mysqld_safe
myisampack                 mysqldump
mysql                      mysqldumpslow
mysql_client_test_embedded mysqlimport
mysql_config               mysqlpump
mysql_config_editor        mysqlshow
mysql_embedded             mysqlslap
mysql_install_db           mysqltest_embedded
mysql_plugin               mysqlxtest
mysql_secure_installation  perror
mysql_ssl_rsa_setup        replace
mysql_tzinfo_to_sql        resolve_stack_dump
mysql_upgrade              resolveip
mysqladmin                 zlib_decompress
➜  bin mysql
zsh: command not found: mysql
➜  bin 

我错过了什么?我也尝试过:

➜  bin ./msql
zsh: no such file or directory: ./msql
➜  bin sh mysql
mysql: mysql: cannot execute binary file
➜  bin 

1 个答案:

答案 0 :(得分:2)

要从当前目录运行程序,您应该使用./

./mysql

您也可以将其添加到PATH,然后您可以从任何目录执行:

mysql