Home > Database > Mysql Tutorial > Solaris操作系统下安装MySQL5札记

Solaris操作系统下安装MySQL5札记

WBOY
Release: 2016-06-07 16:51:34
Original
894 people have browsed it

Solaris操作系统下安装MySQL5就是按照官方的《MySQL5.1参考手册》2.7节ldquo;在其它类Unix系统中安装MySQLrdquo;步骤安装的,还

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选项。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template