solaris操作系统下安装mysql5就是按照官方的《mysql5.1参考手册》2.7节“在其它类unix系统中安装mysql”步骤安装的,还是官方的资料可靠,自己稍微整理一下,,方便查阅。
unix:
$ uname -a
sunos fs-cluster1 5.8 generic_108528-13 sun4u sparc sunw,sun-fire-280r
mysql:
mysql-5.0.45-solaris8-sparc-64bit.tar.gz
一、为mysqld增加一个登录用户和组:
# groupadd mysql
# useradd -d /opt/mysql -g mysql -m mysql
二、挑选一个你想解开分发包的目录,进入该目录。在下面的例子中,我们将分发解包在“/usr/local”下:
# cd /usr/local
三、解包分发版,将创建安装目录。然后生成到该目录的一个符号链接:
# gunzip
# ln -s mysql-5.0.45-solaris8-sparc-64bit mysql
四、进入安装目录:
# cd mysql
你会在mysql目录下发现几个文件和子目录,对安装目的最重要的是“bin”和“scripts”子目录。
·bin
这个目录包含客户端程序和服务器,你应该把这个目录的完整路径加到path环境变量,以便shell能正确的找到mysql程序。
·scripts
这个目录包含mysql_install_db脚本,用来初始化mysql数据库的授权表,其中贮存了服务器访问允许。
五、如果还没有安装mysql,必须创建mysql授权表:
# scripts/mysql_install_db --user=mysql
installing mysql system tables...
ok
filling help tables...
ok
to start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
please remember to set a password for the mysql root user !
to do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h fs-cluster1 password 'new-password'
see the manual for more instructions.
you can start the mysql daemon with:
cd . ; ./bin/mysqld_safe &
you can test the mysql daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
please report any problems with the ./bin/mysqlbug script!
the latest information about mysql is available on the web at
support mysql by buying support/licenses at
#
如果你用root运行命令,应当使用--user选项。选项的值应与你在第一步为运行服务器所创建的登录账户相同。如果你用该用户登录来运行命令,可以省略--user选项。
