ã“ã®è¨˜äº‹ã¯ MySQL Casual Advent Calendar 2014 ã®10日目ã®è¨˜äº‹ã§ã€7日目ã®è¨˜äº‹ grcã§MySQLã®ã‚¯ã‚¨ãƒªçµæžœã«è‰²ã‚’付ã‘ã‚‹ ã¸ã®ã‚¢ãƒ³ã‚µãƒ¼ã‚¨ãƒ³ãƒˆãƒªãƒ¼ã§ã™ :)
MySQL 5.6.12 ã‹ã‚‰ã€mysqlコマンドラインクライアントãŒä½¿ã†ãƒ‡ãƒ•ォルトã®readlineãŒã€ãƒ•ツーã®(?) readlineã‹ã‚‰MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹readlineã«å¤‰ã‚ã£ã¦ã„ã¾ã™ã€‚ãã®ãŸã‚ã€MYSQL_PS1(ã‚„--prompt)ã«echo -eã®å‡ºåŠ›çµæžœã‚’食ã‚ã›ã¦ã‚„ã‚ã†ã¨ã™ã‚‹ã¨
ã“ã†ãªã‚Šã¾ã™ã€‚
ã‚„ã€MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹ã‚„ã¤ã¨ã€ã‚·ã‚¹ãƒ†ãƒ ワイドã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã‚‹ã‚„ã¤ã§ã©ã†readlineã®å®Ÿè£…ãŒé•ã†ã®ã¨ã‹å…¨ã興味ãŒãªã„ã®ã§æœ¬å½“ã«readlineã®ã›ã„ã‹ã©ã†ã‹ã¨èžã‹ã‚Œã‚‹ã¨è‹¥å¹²å›°ã‚‹ã‚“ã§ã™ãŒã€ã‚·ã‚¹ãƒ†ãƒ ワイドã®readlineを使ã†ã‚ˆã†ã«ã—ã¦makeã™ã‚‹ã¨ã¡ã‚ƒã‚“ã¨ã“れを解釈ã§ãるよã†ã«ãªã‚‹ã®ã§ãŸã¶ã‚“MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹readlineã®ã›ã„ã§ã™ï¼ˆé•·ï¼‰
ãªãŠã‚²ã‚¹ã„話ã§ã¯ã‚りã¾ã™ãŒã€æŽ¥ç¶šã—ã¦ã‚‹ã®ãŒãƒžã‚¹ã‚¿ãƒ¼ã‹ã‚¹ãƒ¬ãƒ¼ãƒ–ã‹ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¯rootã‹å¦ã‹ã¨ã‹ã§æ›´ã«è‰²ã‚’出ã—ã‚ã‘ãŸã‚Šã§ãã‚‹ã®ã§ã€ã‚ãŸã—ã¯mysqlコマンドラインクライアントã«ãƒ‘ッãƒã‚’ã™ã‚‹ã®ã‚‚好ãã§ã™ :)
Have fun!!
PlanetMySQL Voting: Vote UP / Vote DOWN
MySQL 5.6.12 ã‹ã‚‰ã€mysqlコマンドラインクライアントãŒä½¿ã†ãƒ‡ãƒ•ォルトã®readlineãŒã€ãƒ•ツーã®(?) readlineã‹ã‚‰MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹readlineã«å¤‰ã‚ã£ã¦ã„ã¾ã™ã€‚ãã®ãŸã‚ã€MYSQL_PS1(ã‚„--prompt)ã«echo -eã®å‡ºåŠ›çµæžœã‚’食ã‚ã›ã¦ã‚„ã‚ã†ã¨ã™ã‚‹ã¨
$ export MYSQL_PS1=$(echo -e "\e[1;33mmysql[\d]\e[0m\n> ")
$ client/mysql -S /usr/mysql/5.6.22/data/mysql.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.22-log Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
1;33mmysql[(none)[0>
1;33mmysql[(none)[0>
1;33mmysql[(none)[0> ^DBye
ã“ã†ãªã‚Šã¾ã™ã€‚
ã‚„ã€MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹ã‚„ã¤ã¨ã€ã‚·ã‚¹ãƒ†ãƒ ワイドã§ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã‚‹ã‚„ã¤ã§ã©ã†readlineã®å®Ÿè£…ãŒé•ã†ã®ã¨ã‹å…¨ã興味ãŒãªã„ã®ã§æœ¬å½“ã«readlineã®ã›ã„ã‹ã©ã†ã‹ã¨èžã‹ã‚Œã‚‹ã¨è‹¥å¹²å›°ã‚‹ã‚“ã§ã™ãŒã€ã‚·ã‚¹ãƒ†ãƒ ワイドã®readlineを使ã†ã‚ˆã†ã«ã—ã¦makeã™ã‚‹ã¨ã¡ã‚ƒã‚“ã¨ã“れを解釈ã§ãるよã†ã«ãªã‚‹ã®ã§ãŸã¶ã‚“MySQLã«ãƒãƒ³ãƒ‰ãƒ«ã•れã¦ã„ã‚‹readlineã®ã›ã„ã§ã™ï¼ˆé•·ï¼‰
$ sudo yum install libedit-devel
$ cmake -DWITH_EDITLINE=system .
$ make mysql
$ export MYSQL_PS1=$(echo -e "\e[1;33mmysql[\d]\e[0m\n> ")
$ client/mysql -S /usr/mysql/5.6.22/data/mysql.sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.22-log Source distribution
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql[(none)]
>
ãªãŠã‚²ã‚¹ã„話ã§ã¯ã‚りã¾ã™ãŒã€æŽ¥ç¶šã—ã¦ã‚‹ã®ãŒãƒžã‚¹ã‚¿ãƒ¼ã‹ã‚¹ãƒ¬ãƒ¼ãƒ–ã‹ã€ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¯rootã‹å¦ã‹ã¨ã‹ã§æ›´ã«è‰²ã‚’出ã—ã‚ã‘ãŸã‚Šã§ãã‚‹ã®ã§ã€ã‚ãŸã—ã¯mysqlコマンドラインクライアントã«ãƒ‘ッãƒã‚’ã™ã‚‹ã®ã‚‚好ãã§ã™ :)
Have fun!!
PlanetMySQL Voting: Vote UP / Vote DOWN