ä»åã¯ãRubyããã°ã©ã ããMySQLã®æä½ããããå ´åã«ãmysql2ã¨ããã©ã¤ãã©ãªãå©ç¨ãã¦MySQLã¸ã¢ã¯ã»ã¹ããæ¹æ³ãç´¹ä»ãããã¨æãã¾ããmysql2ã¯Ruby on Railsã§ãå©ç¨ããã¦ããã©ã¤ãã©ãªã§ãRailsã®ActiveRecordã¨çµã¿åããã¦å©ç¨ãããäºãå¤ãã§ãããä»åã¯Rubyã®ããã°ã©ã ããã¢ã¯ã»ã¹ããæ¹æ³ãç´¹ä»ãããã¨æãã¾ãã æ¤è¨¼ç°å¢ 第10åãyum, rpmã¤ã³ã¹ãã¼ã«ã«ãããMySQL 5.6ã¨MySQL 5.7ã®éãã§ç´¹ä»ãããyumãªãã¸ããªã¼ã使ç¨ããã¤ã³ã¹ãã¼ã«ãå©ç¨ãã¦ãã¾ããã¾ããMySQLã®ãã¼ã¸ã§ã³ã¯5.7.22ã使ç¨ãã¦ãã¾ããã¤ãå æ¥ï¼2018å¹´4æ19æ¥â ï¼â ãMySQ L8.0ãGAã«ãªãã¾ããããä»åã¯5.7ãå©ç¨ãã¦èª¬æãè¡ã£ã¦ããã¾ãã mysql2ãã¤ã³ã¹ãã¼ã«ããéã«ãmysqlã®ããããã¡ã¤ã«ãå¿ è¦ã¨ãªã
TL;DR MySQL 5.7 MySQL 8.0 çé¢ç®ãªèª¬æ Unicode 㨠UTF-16, UTF-8 MySQL ã¸ã®å¿ç¨ ãã¼ã¿ãã¼ã¹ãµã¼ãã¼ã® character set ãã¼ã¿ãã¼ã¹ãµã¼ãã¼ã® collation MySQL 5.7 collation: utf8mb4_general_ci collation: utf8mb4_bin collation: utf8mb4_unicode_ci MySQL 8.0 collation: utf8mb4_0900_ai_ci collation: utf8mb4_0900_bin collation: utf8mb4_general_ci collation: utf8mb4_ja_0900_as_cs collation: utf8mb4_ja_0900_as_cs_ks collation: utf8mb4_unico
æ¦è¦ Docker-composeã§Sinatra + Nginx + MySQL ãåããæã®ããããã¤ã³ã - Qiitaã®ããã°ã©ã ãdocker-composeã§åããã¦ããæã«ð£ï¼ðºåé¡ãããï¼ããåé¡ã«ééãã¾ããã ãã®éã対å¦ã®ããã«mysqlã®æåã³ã¼ãã®è¨å®ãå¤ãããã£ãã®ã§ãããçµæ§ããã£ãã®ã§ã¡ã¢ã§ãã ð£ï¼ðºåé¡ï¼ããï¼ããåé¡ï¼ 以ä¸ãåèã«ãªãã¾ãã MySQL ã¨å¯¿å¸ãã¼ã«åé¡ - ãã¿ã½ãã¼ã MySQL 㧠utf8 㨠utf8mb4 ã®æ··å¨ã§èµ·ããã㨠- @tmtms ã®ã¡ã¢ 解決çã¨ãã¦ã¯æåã³ã¼ãã¯åºæ¬çã«utf8mb4ã使ã£ã¦ãmysqlã®è¨å®ã§collation-server=utf8mb4_binã¨ããã°ããããã docker-composeã§mysqlã®è¨å®ãå¤ããã¨ãã®æ³¨æç¹ docker-composeã«ã¯ãµã¼ãã¹ãã¨ã«c
Ubuntu(18.04 LTS)ã§mysql-serverãmariadb-serverã§ç½®ãæããã¨systemdçµç±ã§mariadbãèµ·åã§ããªãã 追è¨ãã®è¨äºã«ã¯ä¸é¨èª¤ããããã¾ãã 以ä¸ã®è¨äºãåããã¦ã覧ãã ããã ãã©ãã«ã¿ã¤ãã«ã®éãã§ãã Ubuntu 18.04ã§çºçãããã©ãã«ã§ãããä»ã®ãã¼ã¸ã§ã³ã§ãèµ·ããå¾ãããªäºæããã¾ããããããã $ sudo apt install mysql-server $ sudo apt purge mysql-server $ sudo apt install mariadb-server ã¨ããã¨ãæå¾ã®apt installãå¦ã«é ãäºã«æ°ãä»ãã¾ãã ã³ã¬ã¯ãaptãã¤ã³ã¹ãã¼ã«å¾ã«ããã£ããã§mariadbãèµ·åãã¦ãããã®ã§ãããä½ããã®åå ã§ãã°ããçµã£ã¦ãmariadbãèµ·åããªãããã§ãã ãã®å¾ãsystem
WSL(Windows Subsystem for Linux)ã§MySQLã使ããã¨ããéã«ãã»ããã¢ãã(ãã¹ã¯ã¼ãã¾ãã)ã§æéåã£ãã®ã§ãã®åå¿ã«ãªãã¾ãã WSLã®Ubuntu 18.04 LTS MySQL 5.7 MySQL 5.7 ã®ã¤ã³ã¹ãã¼ã« Ubuntu 18.04ã«aptã³ãã³ãã§MySQLãã¤ã³ã¹ãã¼ã«ãããã¨ããã¨ãç¾æç¹(2019/07/23)ã§ã¯ãã¼ã¸ã§ã³5.7ã«ãªãã¾ãã ãªã®ã§ãæ®éã«aptã³ãã³ãã使ç¨ãã¦ã¤ã³ã¹ãã¼ã«ãã¾ãã
å ãã¿ã¯MySQL Casualã®slack ãã®è¾ºä»¥é ãããè¦ã¦ã ããããèªåã2å¹´å(DB移è¡æ)ã«ãã調ã¹ããªã¼ 社å ã¡ã³ãã¼ã«æ¹ãã¦ã¡ããã¨å¨ç¥ããã ãªããè¨äºæ¸ãã ã¨ãã軽ãåå¿é²çãªæãã ã¡ãªã¿ã«ãæããªãã¨ã©ããªããï¼ slackã«ããã£ãããã«ã ã¤ã³ããã¯ã¹ãå¹ããªãï¼(æ½åºã¯ã§ãã) 試ãã«ãã¹ããã¼ãã«ãä½ã(å人ã®è¶£å³ãå¤åã«å«ã¾ãã¦ããã®ã¯æ°ã«ããªããã¨) 使ã£ãç°å¢ã¯MySQL8.0.13 CREATE TABLE `test1` ( `test1_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'testID1', `test1_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'åå', `test1
MySQLã«ã¯ãWindowsçã®ã¤ã³ã¹ãã¼ã©ãç¨æããã¦ããã®ã§ãã¾ãã¯ããããã¦ã³ãã¼ããã¾ãããã https://dev.mysql.com/ ä¸é¨ã¿ãã¡ãã¥ã¼ã®ãDownloadsããã¯ãªãã¯ãã¾ãã å·¦ãµã¤ãã¡ãã¥ã¼ã®ãMySQL Installer ( Windows )ããã¯ãªãã¯ãã¾ãã MySQLã®ã¤ã³ã¹ãã¼ã©ã«ã¯ãWebçµç±ã§ãã¦ã³ãã¼ãããªããã¤ã³ã¹ãã¼ã«ããã¤ã³ã¹ãã¼ã©ï¼ä¸ï¼ã¨ã¤ã³ã¿ã¼ããããç¹ãã£ã¦ããªãã¦ãã¤ã³ã¹ãã¼ã«ã§ããã¤ã³ã¹ãã¼ã©ï¼ä¸ï¼ãããã¾ããããã§ã¯ãWebçµç±ã§ã¤ã³ã¹ãã¼ã«ããã®ã§ä¸ã®ãDownloadããã¯ãªãã¯ãã¾ãã â»ãã®ã¤ã³ã¹ãã¼ã©ã§ã32ãããçï¼64ãããçã®ä¸¡æ¹ãã¤ã³ã¹ãã¼ã«ããã¾ãã ãOracle Web accountãã®ãã°ã¤ã³ãä¿ããã¾ããããã°ã¤ã³ããªãã¦ãï¼ã¢ã«ã¦ã³ããæã£ã¦ããªãã¦ãï¼ã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ãã§ã
ç°å¢ Ubuntu16.04 MySQL5.7.20 ç¾è±¡ ä¹ ã ã«MySQL使ã£ã¦PHPåãããã¨æã£ã¦ç°å¢æ´ãããã¨ããã MySQLã«rootã§ãã°ã¤ã³ã§ããªãã¦è©°ã¾ã£ã $sudo apt-get install mysql-server $ mysql -u root ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) ï¾ ï¾ï½ºï¾ï½° ã¨ãããã調ã¹ã åå ã¨è§£æ±ºæ¹æ³ ã©ãããMySQL5.7ã§mysql-serverãã¤ã³ã¹ãã¼ã«ããæã«rootã®ãã¹ã¯ã¼ããè¨å®ããªãã¨ä¸è¨ã®ã¨ã©ã¼ãåºã¦ãã°ã¤ã³ã§ããªããããï¼ãã¹ã¯ã¼ãè¨å®ããã¨ããããã¦ãªãæ°ããããã ããªãã»ã»ï¼ ããã解決ããã«ã¯ã»ã¼ãã¢ã¼ãã§èµ·åããå¿ è¦ãããã ä¸åèµ·åãã¦ããMySQLãè½ã¨ãã¦ããã»ã¼ãã¢
Ubuntu 18.04 LTS ãã2018å¹´4æ26æ¥ï¼æ¥æ¬æé27æ¥ï¼ã«ãªãªã¼ã¹ãããã ããã§ãæ°è¦ã«ãUbuntu 18.04 LTS Serverããã¤ã³ã¹ãã¼ã«ããã®ã§åå¿é²ãæ®ãã ã¤ã³ã¹ãã¼ã«åªä½ã®å ¥æ ä¸è¨URLãããã¤... æºå MySQLãµã¼ãã¨ã¯ã©ã¤ã¢ã³ããã¼ã«ã®ã¤ã³ã¹ãã¼ã« $ sudo apt install mysql-server mysql-client Ubuntu 16.04 LTS Serverã§ã¯ãã¤ã³ã¹ãã¼ã«æã«ãã¹ã¯ã¼ããè¨å®ããç»é¢ã表示ãããããUbuntu 18.04 LTS Serverã§ã¯ã次é ã§èª¬æãããmysql_secure_installationãã³ãã³ãã§ãã¹ã¯ã¼ãã¯è¨å®ããã ãµã¼ãã¹ã®èµ·åç¢ºèª $ sudo service mysql status â mysql.service - MySQL Community
ã¨ãå®è¡ãã¦ãããã°OKã§ãã ãªãã·ã§ã³ã¯é©å½ã«ä»ãã¦ãã ããã ããã§ã¯è©³ç´°ãæ¸ãã¦ããã¾ãã å ã phpMyAdminã®ã¨ã¯ã¹ãã¼ãæ©è½ã使ã£ã¦ããã¯ã¢ãããåã£ã¦ããã®ã§ããã ãã¡ãã¡ãphpMyAdminããèµ·åããã®é¢åããããªã¼ã¨æã£ã¡ãã£ãã®ãä»åã®ãã£ããã§ãã 横çããã³ã¶ã¤ï¼¼ï¼ï¼ï¼ï¼ï¼ ã»ãã§ãããããããã¨æ¸ãã¦ãåºæ¥ä¸ãã£ãã®ããã¡ãÏï¼ï¼ï¼ï¼ <?php //DBæ å ± $id = "ã¦ã¼ã¶ID"; $pwd = "ãã¹ã¯ã¼ã"; $db = "ãã¼ã¿ãã¼ã¹å"; //åºåãã¡ã¤ã«å $fileName = dirname(__FILE__) . '/db_dump.sql'; //ã³ãã³ãçæ //ã/usr/bin/mysqldump -u $id -p$pwd $db > $fileName ã $cmd = '/usr/bin/mysqldump'; $
æ°ããããã¸ã§ã¯ãã§ã¯ãéå»ã«åããããªæ§æãDockerã§ä½ã£ã¦ããã°Dockerfileãæµç¨ãã¦ãã¾ãã ãã¦ã ä»åã¯ãææ°ã®MySQLã¤ã¡ã¼ã¸ã使ãéã«çºçããåé¡ã«ã¤ãã¦è¨è¼ãã¦ããã¾ãã ã¤ã³ãããã¯ã·ã§ã³ ãã®è¨äºã§å¾ãããã㨠MySQLã®å¤ããã¼ã¸ã§ã³ããã8.0ç³»ã«ç§»è¡ããéã«çããåé¡ã«ã¤ãã¦ãããã ä¹ ãã¶ãã«MySQLã®ã¤ã¡ã¼ã¸ã使ã£ããã¨ã©ã¼ãèµ·ããæã®å¯¾å¦æ¹æ³ãããã ç°å¢ ãã¼ã« ç¨®é¡ ãã¼ã¸ã§ã³ Docker 18.03.1 ã©ã¤ãã©ãª ç¨®é¡ ãã¼ã¸ã§ã³ laravel 5.5 ç¶æ³ Laravelã§ã¢ããªã±ã¼ã·ã§ã³ãä½ã£ã¦ãã¾ãã Dockerã§ä½¿ãã¤ã¡ã¼ã¸ã¯ãApacheã¨MySQLããããã®ææ°ã¤ã¡ã¼ã¸ã使ç¨ãã¦ãã¾ãã MySQLã®Dockerfileã¯ä¸è¨ã§ãã FROM mysql COPY ./docker-entrypoint-initd
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}