本文我们来看看在debian服务器中如何安装二进制mysql5.5.8,以下是安装的详细命令步骤,需要的朋友可以参考一下.
debian需要安装libaio
apt-get install libaio1
然后输入命令:
- shell>groupaddmysql
- shell>useradd-r-gmysqlmysql
- shell>cd/usr/local
- shell>tarzxvf/path/to/mysql-VERSION-OS.tar.gz
- shell>ln-sfull-path-to-mysql-VERSION-OSmysql
- shell>cdmysql
- shell>chown-Rmysql.
- shell>chgrp-Rmysql.
- shell>scripts/mysql_install_db--user=mysql
这里我用的这句:
- scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data
- shell>chown-Rroot.
- shell>chown-Rmysqldata
- shell>cp/usr/local/mysql/support-files/my-small.cnf/etc/my.cnf#Option
这里需要修改innodb设置:
- shell>bin/mysqld_safe--user=mysql&
- shell>cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql.server#Optional
这里设置:
- basedir=/usr/local/mysql
- datadir=/usr/local/mysql/data
最后开机自启动:update-rc.d mysql.server defaults