Chinaunix首页 | 论坛 | 博客
  • 博客访问: 182750
  • 博文数量: 21
  • 博客积分: 1395
  • 博客等级: 中尉
  • 技术积分: 321
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-07 13:57
文章分类

全部博文(21)

文章存档

2012年(1)

2011年(4)

2010年(12)

2009年(2)

2008年(2)

我的朋友

分类: Mysql/postgreSQL

2011-10-18 22:38:33

        ubuntu 源里默认是mysql 5.1。如果要用mysql 5.5,需要自己想办法。google可以找到为ubuntu打包好的5.5的deb。不过ubuntu 11.10刚出来,还没有相应版本的deb包。
        其实mysql有直接可以运行的包。下载mysql-5.5.16-linux2.6-i686.tar.gz。按照mysql文档(http://dev.mysql.com/doc/refman/5.5/en/binary-installation.html)做即可。

  1. shell> groupadd mysql
  2. shell> useradd -r -g mysql mysql
  3. shell> cd /usr/local
  4. shell> tar zxvf mysql-5.5.16-linux2.6-i686.tar.gz
  5. shell> ln -s /usr/local/mysql-5.5.16-linux2.6-i686 mysql
  6. shell> cd mysql
  7. shell> chown -R mysql .
  8. shell> chgrp -R mysql .
  9. shell> scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
  10. shell> chown -R root .
  11. shell> chown -R mysql data
  12. # Next command is optional
  13. shell> cp support-files/my-medium.cnf /usr/local/mysql/my.cnf
  14. shell> bin/mysqld_safe --user=mysql &
  15. # Next command is optional
  16. # 修改 mysql.server中的basedir和datadir
  17. shell> cp support-files/mysql.server /etc/init.d/mysql.server

需要注意的是,执行mysql_install_db时,需要带basedir和datadir两个参数
阅读(2650) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~