ruby gem mysql on cygwin
1£® °²×°Cygwin
ÔËÐÐCygwinµÄ°²×°³ÌÐò¡£´ÓÎļû°üµÄµÄÁбíÖУ¬ÔÚDEVÀïÃæ£¬È·¶¨ÒªÑ¡Ôñ
• Ruby
• gcc
• subversion
ÄãÐèҪʹÓÃgccÀ´½¨Á¢Cygwin°æ±¾µÄMySQL.
2. ÔÚwindowsÉÏÃæ°²×°MYSQL£º
download MySQL 5.0 Windows Installer
3£® °²×°MySQL generic source package²¢ÇÒ½¨Á¢Ëü
°ÑtarballÊͷŵ½Ò»¸öÁÙʱÎļþ¡£
./configure
make install
4£® °²×°Ruby Gems
°´ÕÕÕý³£·½Ê½°²×°£¬ÏÂÔØDownload Gems ÊͷŲ¢°²×°¡£
5£® °²×°Rails:
ÏÖÔÚÄãÒѾÓÐGems£¬Äã¿ÉÒÔ°²×°Rails. Ö´ÐУº
gem insall rails –include-dependencies
6. °²×°mysql gem
ÔËÐÐgem°²×°mysql¡£ µ±³öÏÖÑ¡Ôñʱºò£¬²»Òª°²×°mswin32,
Òª°²×°×îеÄUnix °æ±¾¡£
À©Õ¹µÄ°²×°Ö¸ÁÕâÀïûÓÐÈ«²¿·Òë¶¼Êǰ²×°CygwinµÄÖ¸Á
µ«ÊÇÓÐÒ»¾ä»°ÒªÖصã˵£ºWindows isn’t the greatest environment for development.
Windows²¢²»ÊǺܺõĿª·¢»·¾³¡£
Thanks for http://wiki.rubyonrails.org/rails/pages/RailsonWindowsCygwin
Ïà¹ØÎĵµ£º
1¡¢Ð½¨¶¯Ì¬webÏîÄ¿¡£
2¡¢Ìí¼Ójar°ü
½«mysql jdbcÇý¶¯Ìí¼Óµ½tomcat°²×°Ä¿Â¼ÏµÄlibĿ¼¡£
3¡¢ÔÚMETA-INFÏÂÌí¼Ócontent.xmlÎļþ¡£ÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="true" crossContext="true">
<!-- Default set of monitored resources - ......
cmdÏÂÇл»µ½ mysql °²×°Ä¿Â¼
Àý
d:/mysql/bin
(Èç¹ûÓÃWAMP°²×°ÔòÊÇD:\wamp\bin\mysql\mysql5.1.30\bin)
ǰÌ᣺mysqlÓû§rootÃÜÂëΪ¿Õ.
Êä
Èë mysql -u root mysql
mysql> ״̬ÏÂÊäÈë
update user set password=password('ÐÂÃÜÂë') where user='root';
ȯ
ÏÔ
Quer ......
1,Íü¼ÇrootÃÜÂë,Èç¹ûÄÜ»¹ÄܽøÈëmysqlÇÒ»¹ÓÐmysql¿âµÄȨÏÞ,ÄÇô¾ÍÖ±½ÓÖ´ÐÐ update user set password=password(¡®XXX¡¯) where user=¡¯root¡¯ and host=¡¯XX¡¯; flush privileges; ¼´¿É.Èç¹û²»ÄܽøÈëmysql,ÐèÒªÓÐmysqlÆô¶¯µÄȨÏÞ,ÔÚÆô¶¯mysqlµÄʱºò¼ÓÉÏ--skip-grant-tablesÑ¡Ïî,´Ëʱ½øÈëmysqlÎÞÐèÃÜÂë,ÔÙÖØ¸´ÉÏÊö²Ù ......
½ñÌìÔÚ°ïÅóÓѵ÷ÊÔÒ»¸ö¹ØÓÚ¶àÏ̷߳ÃÎÊͬһÕűíÒýÆðµÄLock wait timeout exceedeµÄÎÊÌ⣬¸Ð¾õÒýÆðµÄÔÒòÓУº
1£¬Ã»ÓнøÐÐÓÅ»¯£¬¾¡Á¿±ÜÃâ¶àÏß³Ì
2£¬¸ù¾ÝËüºóÃæ±¨µÄÒì³££¬ÌáÐÑÎÒ¿ÉÒÔHibernate µÄSessionûÓÐʹÓõõ±£¬(Ò²ÊÇÎÒ½â¾öµÄ·½°¸)
3£¬ÓÃsynchronizedÐÞÊθüбíµÄº¯Êý
¹À¼ÆÊÇÔÀ´³ÌÐòÔÚÐÞ¸ÄÍê¸Ã±íʱÁ¢¿Ì½øÐÐÁ˲åÈë²Ù× ......
Update: This post is outdated. All in one installer for 1.9
is ready now, you should use it if you need 1.9 on windows. Get it here
http://rubyforge.org/frs/?group_id=167
Ruby has “all-in-one” installer for Windows, but it is outdated. As
of May 2009, Ruby 1.9.1 is released, ......