日期:2014-05-16  浏览次数:20695 次

mysqld命令在linux下怎么不识别

用mysqld --no-defaults --verbose --help
查看mysql的相关参数时:
$ mysqld --no-defaults --verbose --help
-bash: mysqld: command not found

如果修改成 :
$ mysql --no-defaults --verbose --help
mysql Ver 14.14 Distrib 5.1.51, for pc-linux-gnu (i686) using EditLine wrapper
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Usage: mysql [OPTIONS] [database]
  -?, --help Display this help and exit.
.....
则能正常运行 

在mysql中运行 :show variables 也能够正常显示命令的相关内容 

请教各位高手 这是为什么
是哪里配置的问题 还是版本的问题?

我的mysql的版本是5.1.51,的源码包安装





------解决方案--------------------
简单来说:mysqld是用来启动mysql数据库的命令,mysql则是打开并执行sql语句的命令。
------解决方案--------------------
调下格式
SQL code
[nicenight@CSDN ~]# echo $PATH
**********:/usr/local/mysql/bin/:*********
[nicenight@CSDN ~]# ls /usr/local/mysql/bin/
comp_err       my_print_defaults  mysql_convert_table_format  mysql_fix_privilege_tables  mysql_setpermission  replace
isamchk        mysql              mysqld_multi                mysqlhotcopy                mysqlshow            resolveip
isamlog        mysqlaccess        mysqld_safe                 mysqlimport                 mysql_tableinfo      resolve_stack_dump
msql2mysql     mysqladmin         mysqldump                   mysql_install               mysqltest
myisamchk      mysqlbinlog        mysqldumpslow               mysql_install_db            mysql_waitpid
myisam_ftdump  mysqlbug           mysql_explain_log           mysqlmanagerc               mysql_zap
myisamlog      mysqlcheck         mysql_find_rows             mysqlmanager-pwgen          pack_isam
myisampack     mysql_config       mysql_fix_extensions        mysql_secure_installation   perror
[nicenight@CSDN ~]# ls /usr/local/mysql/libexec/
mysqld

------解决方案--------------------
http://dev.mysql.com/doc/refman/5.1/zh/index.html
------解决方案--------------------
/usr/local/mysql/libexec/ 这个目录根本不在你的PATH$ 中