+ -
当前位置:首页 → 问答吧 → 命令不能使用的问题

命令不能使用的问题

时间:2010-08-28

来源:互联网

现在有个奇怪的问题,在安装mysql的时候,我在终端下以root身份进入后,groupadd,这些命令不能用。

chenchen#addgroup mysql
                command not found

不知道是不是权限还有问题。请问该如何解决呢?

作者: chenyi816   发布时间: 2010-08-28

加组的命令是:pw groupadd

或者:#vi /etc/group
直接自己手动加

作者: wellwong   发布时间: 2010-08-28

我是按照mysql用户手册做的。
shell> groupadd mysql

shell> useradd -g mysql mysql

shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -

shell> cd mysql-VERSION

shell> ./configure --prefix=/usr/local/mysql

shell> make

shell> make install

shell> cp support-files/my-medium.cnf /etc/my.cnf

shell> cd /usr/local/mysql

shell> bin/mysql_install_db --user=mysql

shell> chown -R root  .

shell> chown -R mysql var

shell> chgrp -R mysql .

shell> bin/mysqld_safe --user=mysql &

但第一步就做不出来了,有种说法是权限的问题。要以root的权限
bash: groupadd: command not found
这是一种解决方案:[xiangdong2@101/udp ~]$ whoami
xiangdong2
[xiangdong2@101/udp ~]$ sudo -s
[root@101/udp ~]# su - root
[root@101/udp ~]# groupadd mysql
但我试过,不行。。。

作者: chenyi816   发布时间: 2010-08-28

如果哪位知道mysql的安装步骤,麻烦给个。我的命令好像就是用不上,也不能编译。铁定哪有问题。

作者: chenyi816   发布时间: 2010-08-28

你那个mysql用户手册是linux的吧,有些命令不太一样,其实你要安装mysql的话,用ports最简单了
#cd /usr/ports/databases/mysql50-server
#make install clean
#nano /etc/rc.conf
mysql_enable="YES"
#cp /usr/local/share/mysql/my-huge.cnf /usr/local/etc/my.cnf
#/usr/local/bin/mysql_install_db --user=mysql
#cp /usr/local/etc/rc.d/mysql-server /usr/local/etc/rc.d/mysql.sh
#/usr/local/etc/rc.d/mysql-server start

作者: wellwong   发布时间: 2010-08-28