cygwin的安装就不说了,网上太多的图文教程了,我们这里主要说下node.js及其相关模块儿和mysql的安装流程和出现的一些问题:
wget http://nodejs.org/dist/node-v0.4.5.tar.gz //获取源码
tar -vxf node-v0.4.5.tar.gz//解压
cd node-v0.4.5//进入node目录
./configure
好了,到了configure这一步,如果报错先尝试
./configure --without-server
如果依旧报错,在ash下敲入命令:
./rebaseall -v
这一步网上有很多出错的案例和解决的方法,可是我在实践的时候,仅仅报can not reaseall,google了半天,最终还是没能找出原因,索性,将cygwin的devl模块儿给重装了下,再次执行前面的流程,configure没报错,问题解决(所以嘛,最笨的办法有时候还真是最省心的办法)。
configure成功后
make
make install
如果没有报错,恭喜你,node顺利安装,你可以敲入命令查看安装的版本
node -v
好了,node安装成功,接着我们说下利用npm安装express等开发框架,首先,我们安装npm,安装时需要从网络上获取资源,会比较慢
curl http://npmjs.org/install.sh | sh
接着通过npm安装express框架,其他框架按部就班就行了
npm install express -g //-g表示安装最新版本
如果npm的时候没有报错,并且顺利安装完成,那么恭喜你,在我写blog的这台电脑上,我npm的时候不会报错,但是在笔记本上会报错(笔记本为win7系统),到现在我也没找到解决的办法。
如果运气不是太坏,node及其开发需要的框架,模块儿应该都安装好了,接着我们说下mysql的安装
安装mysql时我们我们先按部就班:首先在mysql的官网下载generi linux的source文件,下载后
tar -zxvf mysql-*****.tar.gz
进入解压后的目录,然后configure,configure完以后make install,成功后,通过mysql_install_db进行简单的配置,好吧,all done,参考nodejs的文档,自己随便写点儿什么感受下吧。
$ ./scripts/mysql_install_db
$ /usr/local/mysqlbin/mysqld_safe --user=administrator
补充一下日志,前两天在另一台电脑上cygwin环境下安装mysql,make的时候出现错误,错误如下:
make[2]: Entering directory `/cygdrive/c/Users/bk/Downloads/mysql-5.1.45/client'
g++ -DMYSQL_CLIENT_NO_THREADS -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql\""
-DMYSQL_DATADIR="\"/usr/local/mysql/var\"" -I. -I../include -I../include -I../include
-I../regex -O2 -fno-implicit-templates -fno-exceptions -fno-rtti -MT mysql.o -MD
-MP -MF .deps/mysql.Tpo -c -o mysql.o mysql.cc
mysql.cc:1038: error: redefinition of `struct _hist_entry'
../include/readline/readline.h:46: error: previous definition of `struct _hist_entry'
mysql.cc:1041: error: invalid type in declaration before `;' token
mysql.cc:1041: error: conflicting declaration `typedef int HIST_ENTRY'
../include/readline/readline.h:49: error: `HIST_ENTRY' has a previous declaration as
`typedef struct _hist_entry HIST_ENTRY'
mysql.cc: In function `void initialize_readline(char*)':
mysql.cc:2433: error: `rl_completion_func_t' was not declared in this scope
mysql.cc:2433: error: expected primary-expression before `)' token
mysql.cc:2434: error: invalid conversion from `char* (*)(const char*, int)' to `int
(*)(const char*, int)'
mysql.cc:2436: error: `rl_command_func_t' was not declared in this scope
mysql.cc:2436: error: expected primary-expression before `)' token
make[2]: *** [mysql.o] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/bk/Downloads/mysql-5.1.45/client'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/bk/Downloads/mysql-5.1.45/client'
make: *** [all-recursive] Error 1
google了很久,终于找到解决办法,在configure的时候加入以下命令行参数:
./configure --without-server --without-readline CFLAGS=-O2 CXXFLAGS=-O2
漫长的编译后,成功安装mysql。