Hello- Trying to get rails up and running on my linux box with mysql. When I try to install the mysql gem, I get the following: Building native extensions. This could take a while⦠ERROR: While executing gem ⦠(Gem::Installer::ExtensionBuildError) ERROR: Failed to build gem native extension. ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient⦠no checking for main() in -lm⦠y
誰ã®å£ããé£ã³åºããã®ãã¯å®ãã§ã¯ãªãããå··ã§ã¯MySQLã«ã¾ã¤ããæ§ã ãªãé½å¸ä¼èª¬ããã¾ãã¨ãããã«åããã¦ããããã ãæããMySQLã«å¯¾ããç解ãä½ã人ããMySQLããã¾ã好ãã§ã¯ãªãé¢ã ã«ãã£ã¦FUDã£ã½ãè¨ããã¦ããã®ã ã¨æãããä¸ã®ä¸ã«ã¯ãã®ãããªãé½å¸ä¼èª¬ããçã«åãã¦ãã¾ã人ãå± ãã®ãã¾ãäºå®ã§ãã§ãããMySQLã«ãããæ¨ä»ã®éçºã¹ãã¼ãã«ã¯ç®è¦ã¾ãããã®ããããMySQLã¯æ§è½ã»å®å®æ§ã»ä½¿ãæãå ±ã«é²åãç¶ãã¦ãããï¼ç¹ã«å æ¥ãªãªã¼ã¹ãããMySQL 5.5ã¯æ§è½ã»å®å®æ§ã»ä½¿ãæãã両ç«ãã¦ããåªãããã¼ã¸ã§ã³ã ï¼ï¼ï¼ããããé½å¸ä¼èª¬ãã§èªããããã¨ã¯ç·ãã¦ãMySQLã¯ãã¡ãªåã¡ãããã§ããã¨ããçå°ãæ¼ããã®ã°ããã§ãããMySQLerã¨ãã¦ã¯ãã®ãããªè¨ããç¡ãæ±åãå ¨èº«å ¨éããã£ã¦æ´ãããªããã°ãªããªã使å½ãèè² ã£ã¦ãããããã§ãä»æ¥ã¯MySQLã«ã¤ãã¦èªãã
ãã¤ããMySQLã使ãã¨ãã¯ããããã¹ããã¨ãã観ç¹ããè¨äºãæ¸ãã¦ããããä»æ¥ã¯éã«ç¯ãã¦ã¯ãããªãéã¡ããªã¹ãã¢ãããããã¨æãã 1. å ¨ã¦ã®ã«ã©ã ã«ã¤ã³ããã¯ã¹ãã¤ãããã¼ã¿ãã¼ã¹åå¿è ããã£ã¨ããã£ã¦ãã¾ããã¡ãªééãã¯ã³ã¬ã§ã¯ãªãã ããããã¤ã³ããã¯ã¹ã¯ãããæ¤ç´¢ãã¨ã¦ãéããªããããããããããã¨å¼ãæ¿ãã«ã¤ã³ããã¯ã¹ã¯æ´æ°ããã¨ãã«ã³ã¹ããããããããã®åå¤ãã®ãã£ã¹ã¯ã¹ãã¼ã¹ãæ¶è²»ãããç¹ã«æ´æ°ã«ãããã³ã¹ãã¯æã«ç大ã§ã該å½ããã¤ã³ããã¯ã¹ã®ãã¼ã¸ããã£ãã·ã¥ä¸ã«ãªãå ´åã¯ãã£ã¹ã¯ãããã£ãããã®ãã¼ã¸ãèªã¿è¾¼ã¾ãªããã°ãããªãããã£ã¹ã¯ã¢ã¯ã»ã¹ã¯åä½ã«ã¨ã¦ãæéããããã®ã§ãã¤ã³ããã¯ã¹ãå¤æ°ãä¾ãã°å ¨ã¦ã®ã«ã©ã ã«ä»ãã¦ãããããã¨ãããï¼åºã¾ã£ããï¼ãã¨ãããããªç¶æ ã«ãªã£ã¦ãã¾ããã¨ãããã ãããã¤ã³ããã¯ã¹ã¯å¿ è¦ãªã«ã©ã ã«ã ãã¤ããããã«ãã¼ãã«ãè¨è¨ãããã
MySQLã®ã¬ããªã±ã¼ã·ã§ã³ã¯é常ã«ç°¡åã«ä½¿ããå²ã«ã¯å¿ç¨ã®å¹ ãåºãã®ã§é常ã«äººæ°ã®ããæ©è½ã®ä¸ã¤ã§ãããã¬ããªã±ã¼ã·ã§ã³ã®å¿ç¨åéã¯ä¾ãã°ã ããã¯ã¢ãã åç §ç³»ã®è² è·åæ£ HAï¼é«å¯ç¨æ§ï¼ ãã£ã¶ã¹ã¿ãªã«ããªï¼ãµã¤ãéã¬ããªã±ã¼ã·ã§ã³ï¼ BIï¼ã¬ãã¼ãã£ã³ã°etcï¼ ã¨ãã風ã«ã¨ã¦ãå¤ãã®ããªã¨ã¼ã·ã§ã³ãããããã®ããã°ãèªãã§é ãã¦ããçããã®ä¸ã«ãã¬ããªã±ã¼ã·ã§ã³ã使ã£ã¦ããæ¹ã¯å¤ãã®ã§ã¯ãªãã ããããã覧ã®éãMySQLã®ã¬ããªã±ã¼ã·ã§ã³æ©è½ã¯ããã·ã§ã³ã¯ãªãã£ã«ã«åéã§ãå©ç¨ããã¦ããããã¬ããªã±ã¼ã·ã§ã³ã®ä½¿ãæ¹ãé©åã§ãªãã¨ã·ã¹ãã ã®å®å®ç¨¼åã«æ¯éãæ¥ãã¦ãã¾ã£ã¦DBAãã·ã¹ãã 管çè ã®èä½çãç²¾ç¥çè² æ ãå¢å¤§ãã¦ãã¾ããéã«ã¬ããªã±ã¼ã·ã§ã³ãå ç¢ã«éç¨ãããã¨ãåºæ¥ãã°ãã¯ã©ãé«ããã¦ç ããã¨ãããã®ã ãã¬ããªã±ã¼ã·ã§ã³ã¯MySQLã®ä»£è¡¨çãªæ©è½ã§ããã®ã§ãã¬ããªã±ã¼ã·ã§ã³
2007å¹´5æ31æ¥10:53 Tom-AdelsteinãBill-Lubanovicï¼2007å¹´5æ29æ¥ï¼ç«ï¼ï¼ ãã¡ã¤ã«ããã£ã¬ã¯ããªã®ããã¯ã¢ããã¯æ¯è¼çç°¡åã ãããã¼ã¿ãã¼ã¹ã®ããã¯ã¢ããã¨ãªãã¨ãããã¤ãç¹å¥ãªå·¥å¤«ãæ½ãå¿ è¦ããããããã§ã¯MySQLãåãä¸ãã¦ããããåãåçã¯PostgreSQLããã®ä»ã®ãªã¬ã¼ã·ã§ãã«ãã¼ã¿ãã¼ã¹ã«ããã¦ã¯ã¾ãã æ¬ç¨¿ã¯ãæè¿OâReillyããåºçãããæ¸ç±ã Linux System Administration ãã®æç²ã MySQLãµã¼ããä¼ã¿ãªã稼åããç¶ããå¿ è¦ããªããªãã以ä¸ã«ç¤ºããããªå§ç¸®ãªãã®ãªãã©ã¤ã³ããã¯ã¢ããææ³ãæã£ã¨ãæ©ãã MySQLãµã¼ããåæ¢ãããã # /etc/init.d/mysqld stop MySQLã®ãã¼ã¿ãã¡ã¤ã«ããã³ãã£ã¬ã¯ããªãã³ãã¼ãããä¾ãã°ãMySQLã®ãã¼ã¿ãã£ã¬ã¯ããª/var
MixiãFacebookãWikipediaãªã©ã大è¦æ¨¡ãªãµã¤ãã§memcachedãå©ç¨ããä¾ãå¢ãã¦ããããã¤ã³ãã¸ã£ã¼ãã«ã®ã¬ãã¼ãã§Facebookã®äºä¾ç´¹ä»ãããã®ã ãããªãã¨memcachedç¨ã®ãµã¼ãã¯805å°ã§ãã¡ã¢ãªå®¹éã¯15TBã«ããªãããã ããã£ã¹ã¯ã§ã¯ãªãã¡ã¢ãªã ãã§15TBï¼ã§ãããã¢ã¯ãã£ãã¦ã¼ã¶ã¼ã®æ°ã¯7000ä¸äººãããããã ããããããæãã¨ãªãã¨ãã¼ãã¦ã§ã¢ãåãè¦æ¨¡ã«ãªããããå¾ãªãã®ã§ããã ãã®ããã«å¤§è¦æ¨¡ãµã¤ããæ¯ããmemcachedã§ãããããã®ããã°ã©ã ã®ä¸èº«ã¯ä¸ä½ãããªããã®ãªã®ã§ãããããmemcachedã¯http://www.danga.com/memcachedã§ã½ã¼ã¹ã³ã¼ããé å¸ããã¦ãããç¾æç¹ã§ã®ææ°çã¯1.2.5ã§ããããã²ãã¦ã³ãã¼ããã¦ã¿ã¦ã»ãããããã¦ããããã«ãã¡ã¤ã«ãµã¤ãºã確èªãã¦ã¿ã¦ã»ãããããã¨ãããã¨ã«æ°ã¥
mysqlãå©ç¨ãã¦ãã¦ãindexãã¡ããã¨å¼µã£ã¦ããã®ã«ããã©ã¼ãã³ã¹ãåºãªãã explain ã§ã type = ref / key = INDEX çã表示ããã¦ããã®ã«ãããã¯ã¨ãªã¼ãé ãã£ããããã æãåã£ã¦ index ãæ¶ãããéã«ããã©ã¼ãã³ã¹ãæ¹åãã! why? ãã¼ã¿ä»¶æ°ãæ°ä¸ä»¶ãè¶ãããããããããã©ã¼ãã³ã¹ãåçã«ä¸ãã£ãã ã¨ãæ©ãã§ããããã¾ããã? ãããªæ©ã¿ã®ã²ã¨ã¤ã®è§£æ±ºçã«ãªã£ã¦ãããããããã¾ããã ãã¹ã㯠vmplayer ä¸ã® debian etch ã§è¡ãã¾ãã ãã¹ãç°å¢ intel Q6600 ã¡ã¢ãª2Gã® WindowsXPã§ãã ã¯ã¨ãªã¼ããã£ãã·ã¥ãããªãããã«ãã¯ã¨ãªãã£ãã·ã¥ã 0 ã«ãã¾ãã /etc/mysql/my.cnf query_cache_size = 0 #no cahce debug swapã§é ããªãã¨å°
æ°å¤å â 主ã«ä½¿ç¨ããã®ã¯ä»¥ä¸ã[]ã¯ä»»ææå®ãæå®ããªãå ´åã¯ããã©ã«ãå¤ãé©ç¨ãããã Mâ¦æ¡æ° Dâ¦å°æ°ç¹ä»¥ä¸ã®æ¡æ° pâ¦ç²¾åº¦
MySQL ã®ããã©ã¼ãã³ã¹åé¡ã«ééã ãã¼ãã«ã«ã«ã©ã å¤ã NULL ã§ããã¬ã³ã¼ãã大éã«ï¼=50ä¸ä»¶ï¼ ç»é²ããã¦ããã¨ãããNULL ã§ãªãã¬ã³ã¼ãã50ä¸ä»¶ãããããã ã«ã©ã ã«å¯¾ã㦠create index ã§ã¤ã³ããã¯ã¹ãå¼µã£ã¦ããã次㮠SQL æãå®è¡ãã¦ã¿ãã¨ãé常ã«é ãã select * from TABLE where COLM is null 次㮠SQL æã¯éãã select * from TABLE where COLM is not null select * from TABLE where COLM>100 MySQL 㯠NULL å¤ã大éã«ãã㨠is null é¢æ°ã«å¯¾ã㦠ã¤ã³ããã¯ã¹ããã¾ã使ããªããªãã®ã ãããï¼
ãNULLãå«ãã«ã©ã ã«INDEXãå¼µã£ã¦ã使ç¨ãããªãã®ã§ãã§ããã°NULLãæå³ããããã©ã«ãå¤ãè¨å®ããããã¨ããè¨è¿°ãä½åãã¿ããã¨ããã£ã¦ãã¦ã£ããããã ã¨æãè¾¼ãã§ãã¾ãããããMySQLã®ããã¥ã¢ã«ã«ã¯ã column_name IS NULL ã使ç¨ããæ¤ç´¢ã§ã¯ãcolumn_name ã«ã¤ã³ããã¯ã¹ã å¼µããã¦ããå ´åã«ã¤ã³ããã¯ã¹ã使ç¨ããã¾ãã http://dev.mysql.com/doc/refman/4.1/ja/mysql-indexes.html ã¨æ¸ãã¦ããã¾ããããã¶ããNULLãå«ã¾ãã¦ããã¨é§ç®ãªå ´åããããã®ã ã¨æãã¾ãããä¸è¨ã®ãããªã±ã¼ã¹ï¼IS NULLã®æ¯è¼ï¼ã§ã¯åé¡ãªãããã§ãã èªåã§èª¿ã¹ã¦ã¿ããã®ã§ãã
é常ãMySQLã§ã¯ãselectã³ãã³ããå®è¡ããå ´åã1ã¬ã³ã¼ãç®ããæçµã¬ã³ã¼ãã¾ã§ãã·ã¼ã±ã³ã·ã£ã«ã«æ¤ç´¢ãè¡ã£ã¦ããã¾ãã ããããªãããã¬ã³ã¼ãæ°ã大éã«ãªã£ã¦ããã¨ãæ¤ç´¢é度ã®åé¡ãçãã¾ãã ããã§ãããé«éãªæ¤ç´¢ãè¡ãããã«ãã¤ã³ããã¯ã¹ãä½æããã®ãä¸è¬çã§ãã ã¤ã³ããã¯ã¹ãä½æãããã¨ã«ãã£ã¦ãæ¤ç´¢é度ã¯åçã«æ¹åããã¾ãã ä½ããMySQLã§ã¯ã1,000件以ä¸ã§ããã°ã·ã¼ã±ã³ã·ã£ã«ã«æ¤ç´¢ããæ¹ãéãã¨ããã¦ãã¾ãã ãã¦ãã¤ã³ããã¯ã¹ã¨ã¯ã©ã®ãããªãã®ã§ãããã¨ããã¨ãç´æçã«ã¯ãå³æ¸ã®å·»æ«ã«ä»ããã¦ããç´¢å¼ï¼ã¤ã³ããã¯ã¹ï¼ã¨åãã§ãã ç´¢å¼èªã¯ã¢ã¤ã¦ã¨ãªé ããããã¯ãã¢ã«ãã¡ãããé ã«ä¸¦ã¹ããã¦ãã¦ãåã ã®ç´¢å¼èªã«ã¯ããã®ç´¢å¼èªãç»å ´ãããã¼ã¸æ°ï¼ä½ç½®æ å ±ï¼ã示ããã¦ãã¾ãã èªè ã¯ãã®ä½ç½®æ å ±ãé ¼ãã«ããã¼ã¸ãæ²ã£ã¦ãç®çã®ãã¼ã¯ã¼ãã®ããé¨åãèª
livedoor Blog ã®å売ä»ãã¨æããã Seesaa BLOG ã®ä¸ã®äººããã¼ãã¼ã®ããããããæ¸ãã¦ãã Seesaaéçºæ¥è¨ã«ããMySQL - è¤åã¤ã³ããã¯ã¹ã®ããããã¨ããèå³æ·±ãã¨ã³ããªããã£ãã ã¡ãªã¿ã«ããããã¯ä»ã®ä¼ç¤¾ã«å ¥ç¤¾ããã¾ã§ã®éãMySQL èªä½ã¯èªå® ã§éã¶ç¨åº¦ã«ãã使ã£ããã¨ãªãã£ãã®ã§ãã ã¾ã¨ãã«ä½¿ã£ã¦éãã«ï¾ï¾ï½¸ï½°ï¾ããããã¦ãã¾ããããããã§ããã¯ã«ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ã¨ããããã¨ããªãã®ã§ããã£ã¨éããããã¨ããåªåãæ ã£ã¦ã¾ããã ç¹ã«ã¤ã³ããã¯ã¹ãªãã¤ã¼ãã®ã¯ WHERE ç¯ã§ä½¿ããã®ã«åå¥ã«å¼µãã°ããããããªããã¨æã£ã¦ã¾ãããã ã§ããWHERE ç¯ã¨éã ORDER BY ãå ¥ã㨠filesort ãå ¥ã£ã¦ãã¦é ããªããã§ãããã ç®ããã¦ãã³ã§ããã ã¨ãããã¨ã§èªå® ãµã¼ãã§å®é¨ãã¦ã¿ãã å«ãªãã¼ãã«åã ãã©ããã ã¡ãª
ã¡ãã£ã¨ãã£ããâãªã¿ã¤ãã«ãã¤ãã¦ãã¾ã£ãããä»æ¥ã¯ç¬æã¨åè¦ã§MySQLãé«éåããæ¹æ³ã10åç´¹ä»ããããMySQLãµã¼ãããã¥ã¼ãã³ã°ããã¨ããåæå°å ¥ããå ´åãªã©ã«åèã«ãã¦ãããããã 1. ãããã¡ãå¢ãããã¾ãã¯æ¸ãã ãã¥ã¼ãã³ã°ã®åºæ¬ä¸ã®åºæ¬ã§ããããé©åãªãããã¡ãµã¤ãºãè¨å®ãããã¨ã¯ããã©ã¼ãã³ã¹ãã¥ã¼ãã³ã°ã®è¦ã§ããã主ãªãããã¡ã¯æ¬¡ã®éãã innodb_buffer_pool_sizeã»ã»ã»InnoDBã ããå©ç¨ããå ´åã¯ç©ºãã¡ã¢ãªã®7ã8å²ç¨åº¦ãå²ãå½ã¦ãæãéè¦ãªãããã¡ã§ãããä½è«ã ããå®éã«ã¯ããã§å²ãå½ã¦ãå¤ã®5ã10%ããããå¤ãã«ã¡ã¢ãªã使ãã®ã§æ³¨æãå¿ è¦ã ã key_buffer_sizeã»ã»ã»MyISAMã ããå©ç¨ããå ´åã¯ã空ãã¡ã¢ãªã®3å²ç¨åº¦ãå²ãå½ã¦ãã¨ãããæ®ãã¯ãã¡ã¤ã«ã·ã¹ãã ã®ãã£ãã·ã¥ç¨ã«æ®ãã¦ãããã sort_buffer_
å§ãã« Windows ç°å¢ã§ Rails 2.2 ã使ããç°å¢ãä½ããã¨ããã¨ãããMySQL5.1 ã使ç¨ããã¨ã©ã¤ãã©ãªã®é¢ä¿ã§æ£ããåä½ããªãã¨ããäºè±¡ãçºçããã®ã§ãã¼ãããç°å¢ãæ§ç¯ããæé ã¨åããã¦ãããæãè¨è¼ãã¦ããã ã¡ãªã¿ã«ãRails 2.2 ã§ãããã¨ãåå ã§ã¯ç¡ãï¼ããºï¼ãªã®ã§ãåéãããªããããã注æãã ããã Ruby ç°å¢ã®ã¤ã³ã¹ãã¼ã« Ruby æ¬ä½ã®ã¤ã³ã¹ãã¼ã« ä¸è¨ãã Ruby 1.8.7 ã® mswin ç zip ãåå¾ããã é©å½ã«è§£åããï¼å¿ è¦ãããã°é©å½ãªãã£ã¬ã¯ããªã¸ç§»åãã¦ããï¼ PATH ãéã ä»å㯠C:\ ç´ä¸ã« ruby ãã©ã«ããä½æãã¦ããäºã«ããã追å ããPATH㯠C:\Ruby\bin ã¨ãªãã ãã¦ãPATHãéã£ã¦ããã確èªãã¦ã¿ããã C:\>ruby -v ruby 1.8.7 (2008-08-11 pa
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}