经过两天的挣扎,用apt-get 安装mysql始终报错,网上查了不少资料,就是不行,下了二进制包来安装,结果提示缺少一些包,还是不行,最后只有试试从源码安装了,这是我从网上找的一篇文章,经过本人20多分钟的编译,终于成功了,能正常运行.
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
以上命令均用root权限执行
当在./configure的时候出现No curses/termcap library found错误的时候,不要着急,只是缺少了libncursers5-dev的原因

sudo apt-get install libncursers5-dev //此处libncursers5-dev中有一两个字母错误,暂时记不清了,可以用apt-cache search 找出来,问题不大