Chinaunix首页 | 论坛 | 博客
  • 博客访问: 422470
  • 博文数量: 77
  • 博客积分: 2303
  • 博客等级: 大尉
  • 技术积分: 808
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-30 09:15
文章存档

2015年(1)

2013年(3)

2012年(2)

2011年(46)

2009年(4)

2008年(2)

2005年(12)

2004年(7)

我的朋友

分类: Mysql/postgreSQL

2011-02-25 14:36:29

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.建用户和组
  1. groupadd -g 1010 mysql
  2. useradd -u 1010 -d /export/home/mysql -g mysql -s /bin/false -c "MySQL User" -m mysql
3.解包安装
  1. cd /export/home/mysql
  2. rm *
  3. gzcat /export/home/feifan/soft/mysql-5.5.9-solaris10-i386.tar.gz | tar -xvf -
  4. ln -s mysql-5.5.9-solaris10-i386 mysql
4.初始化数据库
  1. cd /export/home/mysql/mysql-5.5.9-solaris10-i386
  2. scripts/mysql_install_db --datadir=/export/home/mysql/data

  1. Installing MySQL system tables...
  2. OK
  3. Filling help tables...
  4. OK

  5. To start mysqld at boot time you have to copy
  6. support-files/mysql.server to the right place for your system

  7. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
  8. To do so, start the server, then issue the following commands:

  9. ./bin/mysqladmin -u root password 'new-password'
  10. ./bin/mysqladmin -u root -h mdc-solsvr password 'new-password'

  11. Alternatively you can run:
  12. ./bin/mysql_secure_installation

  13. which will also give you the option of removing the test
  14. databases and anonymous user created by default. This is
  15. strongly recommended for production servers.

  16. See the manual for more instructions.

  17. You can start the MySQL daemon with:
  18. cd . ; ./bin/mysqld_safe &

  19. You can test the MySQL daemon with mysql-test-run.pl
  20. cd ./mysql-test ; perl mysql-test-run.pl

  21. Please report any problems with the ./bin/mysqlbug script!

  1. chown -R mysql:mysql /export/home/mysql
5.启动脚本svc-mysql
  1. cp support-files/mysql.server /lib/svc/method/svc-mysql
  2. chown root:bin /lib/svc/method/svc-mysql
  3. chmod 555 /lib/svc/method/svc-mysql
vi /lib/svc/method/svc-mysql
修改
  1. basedir='/export/home/mysql/mysql'
  2. datadir='/export/home/mysql/data'
6.mysql.xml
  1. cd /var/svc/manifest/application/database
vi mysql.xml
  1. <?xml version="1.0"?>
  2. <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
  3. <!--
  4.         ident "@(#)mysql.xml 5.5.9 11/02/22 SMI"
  5.         By feifan@CU
  6. -->

  7. <service_bundle type='manifest' name='mysql'>

  8. <service
  9.         name='application/database/mysql'
  10.         type='service'
  11.         version='1'>
  12.         <create_default_instance enabled='false' />
  13.         <single_instance />

  14.         <!--
  15.            Wait for all local filesystems to be mounted.
  16.         -->
  17.         <dependency
  18.                 name='filesystem-local'
  19.                 grouping='require_all'
  20.                 restart_on='none'
  21.                 type='service'>
  22.                 <service_fmri value='svc:/system/filesystem/local:default' />
  23.         </dependency>

  24.         <!--
  25.            Wait for network loopback to be initialized.
  26.         -->
  27.         <dependency
  28.                 name='loopback'
  29.                 grouping='require_all'
  30.                 restart_on='none'
  31.                 type='service'>
  32.                 <service_fmri value='svc:/network/loopback' />
  33.         </dependency>

  34.         <method_context>
  35.                 <method_credential user='mysql' group='mysql' />
  36.         </method_context>

  37.         <exec_method
  38.                 type='method'
  39.                 name='start'
  40.                 exec='/lib/svc/method/svc-mysql start'
  41.                 timeout_seconds='200' />

  42.         <exec_method
  43.                 type='method'
  44.                 name='stop'
  45.                 exec='/lib/svc/method/svc-mysql stop'
  46.                 timeout_seconds='200' />

  47.         <exec_method
  48.                 type='method'
  49.                 name='restart'
  50.                 exec='/lib/svc/method/svc-mysql restart'
  51.                 timeout_seconds='60' />

  52.         <exec_method
  53.                 type='method'
  54.                 name='refresh'
  55.                 exec='/lib/svc/method/svc-mysql reload'
  56.                 timeout_seconds='60' />

  57.         <exec_method
  58.                 type='method'
  59.                 name='status'
  60.                 exec='/lib/svc/method/svc-mysql status'
  61.                 timeout_seconds='60' />

  62.         <stability value='Evolving' />

  63.         <template>
  64.                 <common_name>
  65.                         <loctext xml:lang='C'>
  66.                                 MySQL RDBMS
  67.                         </loctext>
  68.                 </common_name>
  69.                 <documentation>
  70.                         <manpage title='mysql' section='8' />
  71.                         <doc_link name='mysql.com'
  72.                                 uri='' />
  73.                 </documentation>
  74.         </template>

  75. </service>

  76. </service_bundle>

  1. chown root:sys /var/svc/manifest/application/database/mysql.xml
  2. chmod 444 /var/svc/manifest/application/database/mysql.xml

  3. svccfg -v validate /var/svc/manifest/application/database/mysql.xml
  4. svccfg -v import /var/svc/manifest/application/database/mysql.xml

  5. svcadm enable mysql
  6. 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
  1. perl Makefile.PL \
  2.     --libs="-L/export/home/mysql/mysql/lib -lmysqlclient -lz" \
  3.     --cflags=-I/export/home/mysql/mysql/include \
  4.     --testhost=127.0.0.1

  1. make
  2. make test # Some minor error messages can be ignored here
  3. make install

  4. cd sql-bench
  5. ./run-all-tests

阅读(2177) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~