1. 下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.9-solaris10-i386.tar.gz/from/http://mysql.easynet.be/
2.建用户和组
- groupadd -g 1010 mysql
-
useradd -u 1010 -d /export/home/mysql -g mysql -s /bin/false -c "MySQL User" -m mysql
3.解包安装
- cd /export/home/mysql
-
rm *
-
gzcat /export/home/feifan/soft/mysql-5.5.9-solaris10-i386.tar.gz | tar -xvf -
-
ln -s mysql-5.5.9-solaris10-i386 mysql
4.初始化数据库
- cd /export/home/mysql/mysql-5.5.9-solaris10-i386
-
scripts/mysql_install_db --datadir=/export/home/mysql/data
- 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 mdc-solsvr password 'new-password'
-
-
Alternatively you can run:
-
./bin/mysql_secure_installation
-
-
which will also give you the option of removing the test
-
databases and anonymous user created by default. This is
-
strongly recommended for production servers.
-
-
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!
- chown -R mysql:mysql /export/home/mysql
5.启动脚本svc-mysql
- cp support-files/mysql.server /lib/svc/method/svc-mysql
-
chown root:bin /lib/svc/method/svc-mysql
-
chmod 555 /lib/svc/method/svc-mysql
vi /lib/svc/method/svc-mysql
修改
- basedir='/export/home/mysql/mysql'
-
datadir='/export/home/mysql/data'
6.mysql.xml
- cd /var/svc/manifest/application/database
vi mysql.xml
- <?xml version="1.0"?>
-
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
-
<!--
-
ident "@(#)mysql.xml 5.5.9 11/02/22 SMI"
-
By feifan@CU
-
-->
-
-
<service_bundle type='manifest' name='mysql'>
-
-
<service
-
name='application/database/mysql'
-
type='service'
-
version='1'>
-
<create_default_instance enabled='false' />
-
<single_instance />
-
-
<!--
-
Wait for all local filesystems to be mounted.
-
-->
-
<dependency
-
name='filesystem-local'
-
grouping='require_all'
-
restart_on='none'
-
type='service'>
-
<service_fmri value='svc:/system/filesystem/local:default' />
-
</dependency>
-
-
<!--
-
Wait for network loopback to be initialized.
-
-->
-
<dependency
-
name='loopback'
-
grouping='require_all'
-
restart_on='none'
-
type='service'>
-
<service_fmri value='svc:/network/loopback' />
-
</dependency>
-
-
<method_context>
-
<method_credential user='mysql' group='mysql' />
-
</method_context>
-
-
<exec_method
-
type='method'
-
name='start'
-
exec='/lib/svc/method/svc-mysql start'
-
timeout_seconds='200' />
-
-
<exec_method
-
type='method'
-
name='stop'
-
exec='/lib/svc/method/svc-mysql stop'
-
timeout_seconds='200' />
-
-
<exec_method
-
type='method'
-
name='restart'
-
exec='/lib/svc/method/svc-mysql restart'
-
timeout_seconds='60' />
-
-
<exec_method
-
type='method'
-
name='refresh'
-
exec='/lib/svc/method/svc-mysql reload'
-
timeout_seconds='60' />
-
-
<exec_method
-
type='method'
-
name='status'
-
exec='/lib/svc/method/svc-mysql status'
-
timeout_seconds='60' />
-
-
<stability value='Evolving' />
-
-
<template>
-
<common_name>
-
<loctext xml:lang='C'>
-
MySQL RDBMS
-
</loctext>
-
</common_name>
-
<documentation>
-
<manpage title='mysql' section='8' />
-
<doc_link name='mysql.com'
-
uri='' />
-
</documentation>
-
</template>
-
-
</service>
-
-
</service_bundle>
- chown root:sys /var/svc/manifest/application/database/mysql.xml
-
chmod 444 /var/svc/manifest/application/database/mysql.xml
-
-
svccfg -v validate /var/svc/manifest/application/database/mysql.xml
-
svccfg -v import /var/svc/manifest/application/database/mysql.xml
-
-
svcadm enable mysql
-
svcs -l mysql
#运行sql-bench
cd sql-bench
./run-all-tests
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at (eval 54) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Pg, Proxy, Sponge.
at /export/home/mysql/mysql-5.5.9-solaris10-i386/sql-bench/server-cfg line 247
安装DBD
最新的4.018编译有问题,用3.0008通过.
wget http://cpan.develooper.com/authors/id/C/CA/CAPTTOFU/DBD-mysql-3.0008.tar.gz
gzcat DBD-mysql-3.0008.tar.gz | tar -xvf -
cd DBD-mysql-3.0008
- perl Makefile.PL \
-
--libs="-L/export/home/mysql/mysql/lib -lmysqlclient -lz" \
-
--cflags=-I/export/home/mysql/mysql/include \
-
--testhost=127.0.0.1
- make
-
make test # Some minor error messages can be ignored here
-
make install
-
-
cd sql-bench
-
./run-all-tests
阅读(2177) | 评论(0) | 转发(0) |