|
发表于 2003-5-11 20:40:31
|
显示全部楼层
The basic commands you must execute to install and use a MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/safe_mysqld --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
if you are running MySQL 4.x
6) 为 root 设置密码
/usr/local/mysql/bin/mysqladmin -u root -p password your_new_password
注意,第一个 password 是命令的参数,依原样键入,而 your_new_password 就是你要设置的新密码。例如,要将 root 密码设为123456,那么这样输入命令:
/usr/local/mysql/bin/mysqladmin -u root -p password 123456
回车后系统会提示你输入当前密码,应该是像下面这样:
Enter password:
因为此时还没有密码,所以直接回车即可,这时没有任何提示返回提示符状态,而密码已经设置完成。此时可以通过关闭 MySQL 服务验证密码是否生效:
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
Enter password:123456
系统提示 MySQL 已关闭:
020531 13:14:35 mysql ended
[1]+ Done /usr/local/mysql/bin/safe_mysqld --user=mysqlshell> bin/safe_mysqld &
但是启动的时候提示starting mysqld daemon from /.........../...
mysqld ended
启动不了 这种情况通常是因为/tmp目录的权限问题chmod 777 /tmp, |
|