ubuntu 源里默认是mysql 5.1。如果要用mysql 5.5,需要自己想办法。google可以找到为ubuntu打包好的5.5的deb。不过ubuntu 11.10刚出来,还没有相应版本的deb包。
- shell> groupadd mysql
-
shell> useradd -r -g mysql mysql
-
shell> cd /usr/local
-
shell> tar zxvf mysql-5.5.16-linux2.6-i686.tar.gz
-
shell> ln -s /usr/local/mysql-5.5.16-linux2.6-i686 mysql
-
shell> cd mysql
-
shell> chown -R mysql .
-
shell> chgrp -R mysql .
-
shell> scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
-
shell> chown -R root .
-
shell> chown -R mysql data
-
# Next command is optional
-
shell> cp support-files/my-medium.cnf /usr/local/mysql/my.cnf
-
shell> bin/mysqld_safe --user=mysql &
-
# Next command is optional
-
# 修改 mysql.server中的basedir和datadir
-
shell> cp support-files/mysql.server /etc/init.d/mysql.server
需要注意的是,执行mysql_install_db时,需要带basedir和datadir两个参数
阅读(2694) | 评论(0) | 转发(1) |