Solaris操作系统下安装MySQL5札记

Linux大全评论625 views阅读模式

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 < /opt/mysql-5.0.45-solaris8-sparc-64bit.tar.gz | tar -xvf -

# 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!

企鹅博客
  • 本文由 发表于 2020年9月7日 03:50:16
  • 转载请务必保留本文链接:https://www.qieseo.com/145279.html

发表评论