MySQLはじめの第一歩

44,774 views

Published on

2014年12月10日に開催されたOSC.Enterprise の資料です。
企業でMySQLを使ってみたい、はじめてMySQLを触ってみたい、そんな方々に対して、MySQLの歴史、インストール方法から運用まで、簡単に紹介

Published in: Software

MySQLはじめの第一歩

  1. 1. MySQL䛾ጞ䜑䛾➨୍Ṍ ᪥ᮏMySQL䝴䞊䝄఍ ㉥஭㻌ㄔ © Copyright 2012 MyNA
  2. 2. 䜰䝆䜵䞁䝎 • ᪥ᮏMySQL䝴䞊䝄఍䛻䛴䛔䛶 • ⮬ᕫ⤂௓ • MySQL䛳䛶䛺䛻䠛 • MySQL䛸MyNA䛾Ṕྐ • MySQL䛾䜲䞁䝇䝖䞊䝹 • 䝞䝑䜽䜰䝑䝥䛺䛹 2 © Copyright 2012 MyNA.
  3. 3. ⮬ᕫ⤂௓ MyNA = MySQL Nippon Association • ྡ๓䠖㻌㻌㉥஭㻌ㄔ㻌㻌(Makoto AKAI) • ఱ䜔䛳䛶䛔䜛ே – ♫㛗㻌(MKT䜲䞁䝍䞊䝘䝅䝵䝘䝹ᰴᘧ఍♫㻌௦⾲ྲྀ⥾ᙺ) – ୺䛻䚸䝬䞊䜿䝔䜱䞁䜾ᴗົ䛾䜰䜴䝖䝋䞊䝅䞁䜾䛺䛹 – 䜻䝱䝸䜰䜻䝱䜴䞁䝉䝷䞊䚸ⱥㄒᏛ⩦䝁䞊䝏䛷䜒䛒䜛 • MySQL/MyNA䛸䛾㛵ಀ – MySQL䜽䝑䜽䝤䝑䜽(䜸䝷䝸䞊䠅㻌䛾⩻ヂ䜢䛝䛳䛛䛡䛻䚸MySQL/MyNA䛷ά ື㛤ጞ – ᪥ᮏHP᫬௦䛻䛿䚸MySQL㛵ಀ䛾௙஦ᢸᙜ – ௒䛿䚸⣧⢋䛺䝴䞊䝄䞊䛾ே䠄䛯䛰䛧䚸ᮏᙜ䛻䝴䞊䝄䞊䠅 3 © Copyright 2012 MyNA.
  4. 4. 4 © Copyright 2012 MyNA.
  5. 5. ᪥ᮏMySQL䝴䞊䝄఍䛻䛴䛔䛶㻌 MyNA = MySQL Nippon Association 䠄䝬䜲䝘䛸ㄞ䜐䠅 • ┠ⓗ – ᪥ᮏ䛷䛾㻌MySQL 䛾ᬑཬ䜢ᅗ䜛䚹 – 䝴䞊䝄㛫䛾䝁䝭䝳䝙䜿䞊䝅䝵䞁䜢ᅗ䜛䚹 – MySQL 䛾᪥ᮏㄒ໬䛾᳨ド/㛤Ⓨ䜢⾜䛺䛖䚹 • άື – ⌧ᅾ䛾୺䛺άື䛿㻌ML 䛷䛾ពぢ஺᥮䛷䛩䚹 • ධ఍ – MySQL 䛻⯆࿡䛜䛒䜛᪉䛿䛹䛺䛯䛷䜒ධ఍䛷䛝䜎䛩䚹఍㈝䛿䛒䜚䜎䛫䜣䛧䚸㻌 ㏥఍䜒⮬⏤䛷䛩䚹 5 © Copyright 2012 MyNA.
  6. 6. MySQL䛾Ṕྐ Monty Widenius䛜㛤Ⓨ䛛㛤ጞ 1995ᖺ䛻MySQL 1.0䛜䝸䝸䞊㻌䝇 䝋䞊䝇䝁䞊䝗බ㛤䚸1996ᖺ㻌 6 6 © Copyright 2012 MyNA.
  7. 7. MySQL䛾Ṕྐ ྡ๓䛾⏤᮶ 䛂MySQL䛃䛸䛔䛖ྡ๓䛾⏤᮶䛿᫂䜙䛛䛷䛿䛺䛔 ㄝ䠍䠖Monty䛾ፉ䛥䜣䛾ྡ๓䛜My 䛷䛒䜛䛯䜑 䛂MySQL䛃䛻䛺䛳䛯 ㄝ2: MySQL䛾ᇶᮏ䝕䜱䝺䜽䝖䝸䛚䜘㻌䜃ከᩘ䛾䝷 䜲䝤䝷䝸䜔䝒䞊䝹䛻䛂my䛃䛸䛔䛖䝥䝸䝣䜱䝑䜽䝇䛜౑ 䜟䜜䛶䛔䜛䛯䜑 7 © Copyright 2012 MyNA.
  8. 8. MySQL䛾Ṕྐ 䝻䝂䛾⏤᮶ MySQL䛾䝻䝂䛷䛒䜛䜲䝹䜹䛾ྡ๓䠖䛂Sakila䛃㻌 Sakila䛸䛔䛖ྡ๓䛿䚸䜰䝣䝸䜹䛾䝇䝽䝆䝷䞁䝗ฟ㌟ 䛾䜸䞊䝥䞁䝋䞊䝇㛤Ⓨ⪅Ambrose Twebaze䛜 ᥦ᱌䛧䚸MySQL AB䛾๰タ⪅䛜㑅䜣䛰䜒䛾 8 8 © Copyright 2012 MyNA.
  9. 9. MySQL䛾Ṕྐ ୡ⏺䛷2␒┠䛾䝕䞊䝍䝧䞊䝇 ⌧ᅾ䚸MySQL䛾䝎䜴䞁䝻䞊䝗ᩘ䛿1000୓ே䠇 ၟ⏝RDB䛷䛒䜛㻌Oracle Database䛻⥆䛝䚸ୡ⏺ 䛷2␒┠䛾䝕䞊䝍䝧䞊䝇䛾1䛴䛻 http://db-engines.com/en/ranking 9 9 © Copyright 2012 MyNA.
  10. 10. MySQL䛻䛿䚸ၟ⏝∧䛸䝁䝭䝳䝙䝔䜱∧ 䝁䝭䝳䝙䝔䜱∧ MySQL Community Server ↓ൾ䛷䝎䜴䞁䝻䞊䝗䛧䛶฼㻌⏝䛷䛝䜎䛩䚹䝁䝭䝳䝙䝔䜱䛻䜘䜚䝃䝫䞊䝖 ၟ⏝∧ ௻ᴗ䜔ᨻᗓ䚸⮬἞య䛺䛹䛷䛿䚸MySQL䝁䝭䝳䝙䝔䜱䛻䜘䜛௨ୖ䛾䝃䝫䞊䝖䛜ᚲせ䛻䛺䜛ሙྜ䜒䛒䜚 䜎䛩䚹䛭䛾ሙྜ䛻䛿䚸ၟ⏝∧䜢฼⏝䛩䜛䛣䛸䜒䛷䛝䜎䛩䚹 • ၟ⏝∧䛻䛿䚸୺䛻௨ୗ䛾Edition䚹䛔䛪䜜䜒䚸ᐃᮇⓗ䛺䜰䝑䝥䝕䞊䝖䜔䚸㻌䝃䞊䝡䝇䝟䝑䜽䚸ᢏ⾡䝃䝫䞊䝖䚸㧗ᗘ䛺 ⟶⌮䝒䞊䝹䛺䛹䛜ྵ䜎䜜䛶䛔䜛 – 䞉MySQL Standard Edition 䞉MySQL Enterprise Edition 䞉MySQL Cluster Carrier Grade Edition 10 © Copyright 2012 MyNA.
  11. 11. MySQL䜢ጞ䜑䜛 OS䛿䛺䛻䠛 MySQL䛸䛔䛘䜀䚸Linux 䛸䛔䛖༳㇟䜒䛒䜚䜎䛩䛜䚸MacOS, Windows䛻䜒ᑐᛂ Windows ∧䛾䝯䝸䝑䝖 • Apache䜔PHP䛾䝞䞊䝆䝵䞁䜢ㄪ䜉䛶䜲䞁䝇䝖䞊䝹䜢䛩䜛ᚲせ䛺䛔⎔ቃ䛜ᥦ౪ 䛥䜜䛶䛔䜛 • ౛䛘䜀䚸Web䝃䞊䝞䞊䛻䛒䛯䜛IIS䛿䚸Windows 7/8 䛻䝕䝣䜷䝹䝖䜲䞁䝇䝖䞊 䝹῭䜏 • PHP䛻䛴䛔䛶䛿䚸MS䛜ᥦ౪䛩䜛Web 㻼I 䝒䞊䝹䛷౫Ꮡ㛵ಀ䜢⪃៖䛧䛶䜲䞁䝇 䝖−䝹 • 䛭䛾௚䛾䜰䝥䝸䛻䝞䞁䝗䝹䛥䜜䛯MySQL䛿䚸ྂ䛛䛳䛯䜚䚸≉ู䛺タᐃ䛜䛺䛥䜜 䛶䛔䜛䛣䛸䛜䛒䜛 11 © Copyright 2012 MyNA.
  12. 12. MySQL䛾䜲䞁䝇䝖䞊䝹(1) 䛹䛣䛛䜙䝎䜴䞁䝻䞊䝗? MySQL䛻䛿ఏ⤫ⓗ䛻䛂15ศ 䝹䞊䝹䛃䛸䛔䛖Ỵ䜎䜚䛤䛸䚹 䛣䛾ព࿡䛿䚸䛂䝎䜴䞁䝻䞊䝗䛛䜙 15ศ௨ෆ䛻MySQL䝃䞊䝞䞊 䛾䜲䞁䝇䝖䞊䝹䛜᏶஢䛧㉳ື䛷 䛝䜛䛃䜘䛖䛻䚸ྍ⬟䛺㝈䜚౑䛔䜔 䛩䛟䝟䝑䜿䞊䝆䞁䜾䛩䜛㻌 12 © Copyright 2012 MyNA. http://dev.mysql.com/
  13. 13. MySQL䛾䜲䞁䝇䝖䞊䝹(2) 䛹䛣䛛䜙䝎䜴䞁䝻䞊䝗? MySQLබᘧ䝃䜲䝖䛷䛿䚸OS䛻 ྜ䜟䛫䛶䛔䛟䛴䛛䛾䝟䝑䜿䞊䝆 䜢ᥦ౪ Windows䛷䛿䚸MSI Installer 䛻ຍ䛘䛶䚸zip䝟䝑䜿䞊䝆䛜䛒䜚 䜎䛩䚹䜎䛯䚸Linux⏝䛻䛿䚸rpm 䝟䝑䜿䞊䝆䜔tarᙧᘧ䝟䝑䜿䞊 䝆䚸MacOS⏝䛻䛿䚸dmg䝟䝑 䜿䞊䝆tarᙧᘧ䝟䝑䜿䞊䝆䜢฼ ⏝ྍ⬟ 13 © Copyright 2012 MyNA. http://dev.mysql.com/downloads/windows/installer/
  14. 14. MySQL䛾䜲䞁䝇䝖䞊䝹(3) 䛹䛣䛛䜙䝎䜴䞁䝻䞊䝗? MySQL Installer MySQL Installer provides an easy to use, wizard-based installation experience for all MySQL software on Windows. MySQL Connectors MySQL offers industry standard database driver connectivity for using MySQL with applications and tools. MySQL Workbench MySQL Workbench provides DBAs and developers an integrated tools environment for database design, administration, SQL development and database migration. with MySQL Installer. 14 © Copyright 2012 MyNA. http://dev.mysql.com/downloads/windows/installer/
  15. 15. MySQL䛾䜲䞁䝇䝖䞊䝹(4) 䛹䛣䛛䜙䝎䜴䞁䝻䞊䝗? MySQL for Excel MySQL for Excel enables users to import, export and edit MySQL data using Microsoft Excel. Available with MySQL Installer. MySQL Notifier MySQL Notifier enables developers and DBAs to easily monitor, start and stop MySQL database instances. Available with MySQL Installer. MySQL for Visual Studio MySQL for Visual Studio provides access to MySQL objects and data using Visual Studio. Available with MySQL Installer. 15 © Copyright 2012 MyNA.
  16. 16. MySQL Installer㻌䛾ᅔ䛳䛯䛸䛣䜝 䝁䝭䝳䝙䝔䜱∧䛾䜏 ୍㒊䚸䜶䝷䞊䛜䛷䜛䛣䛸䛜䜘䛟䛒䜚䜎䛩䚹 䛣䜜䛿䚸䝬䜲䝘䞊䝞䞊䝆䝵䞁䜰䝑䝥䛜㉳䛣䜛䛸䠄䝁䝭䝳䝙䝔䜱∧䛿㢖⦾䛻䜰䝑䝥䝕䞊䝖䠅䚸䛺䛻䛛 䛚䛛䛧䛔䛸䛣䜝䛜ฟ䜎䛩 ሗ࿌䜢䛣䜎䜑䛻䛩䜛䛣䛸䛜ᚲせ 16 © Copyright 2012 MyNA.
  17. 17. 䝁䝬䞁䝗䝷䜲䞁䜽䝷䜲䜰䞁䝖 MySQL䛻᥋⥆䛩䜛 • Windows 䝁䝬䞁䝗䝥䝻䞁䝥䝖䛺䛹䛷ືస䛩䜛䝒䞊䝹䚹MySQL⮬య䛿䚸䝃䞊 䝞䞊䜰䝥䝸䜿䞊䝅䝵䞁䚹MySQL䝃䞊䝞䞊䜈䛾䜰䜽䝉䝇᪉ἲ䛾䠍䛴䛿䚸MySQL 䛻ᑐ䛧䛶SQLᩥ䜢Ⓨ⾜䛩䜛䜽䝷䜲䜰䞁䝖䝋䝣䝖䜴䜵䜰䛷䛒䜛䝁䝬䞁䝗䝷䜲䞁䜽䝷䜲 䜰䞁䝖䜢฼⏝䛩䜛 • 䝁䝬䞁䝗䝷䜲䞁䜽䝷䜲䜰䞁䝖䛿㉳ື䛩䜛䛸MySQL䝃䞊䝞䞊䛻᥋⥆䜢⾜䛔䜎䛩䚹 䝁䝬䞁䝗䝷䜲䞁䜽䝷䜲䜰䞁䝖䜢㉳ື䛩䜛䛻䛿䚸Windows 8.1䜰䝥䝸⏬㠃䛻㓄⨨䛥 䜜䛶䛔䜛MySQL Command Line Client 䛛䜙⾜䛖᪉ἲ䛸䚸Windows䛾䝁䝬䞁 䝗䝥䝻䞁䝥䝖䛛䜙⾜䛖᪉ἲ 17 © Copyright 2012 MyNA.
  18. 18. ᩥᏐ䝁䞊䝗 MySQL䛷᭱ึ䛻䛴䜎䛪䛟䛣䛸䜒ከ䛔 • MySQL䛷䛿䚸ᶆ‽䛷䛿䚸䝣䜯䜲䝹my.cnf䛷ᩥᏐ䝁䞊䝗䛾タᐃ䛺䛹䛾䛔䜝䛔䜝䛺 䜸䝥䝅䝵䞁䚹 • 䛧䛛䛧䚸Windows䛷䛿ఏ⤫ⓗ䛻.cnf䛾ᣑᙇᏊ䛜䛂▷⦰䝎䜲䝲䝹䛃䛻๭䜚ᙜ䛶䜙 䜜䛶䛔䛶MySQL䛾タᐃ䝣䜯䜲䝹䛸䛧䛶䛿౑䛔䛵䜙䛔䛯䜑䚸my.ini䛸䛔䛖䝣䜯䜲 䝹ྡ䜒฼⏝ྍ⬟ • MySQL 䛾䝞䞊䝆䝵䞁5.5䛛䜙ᑟධ䛥䜜䛯Windows Vista 䛛䜙㏣ຍᩥᏐ䛻ᑐ ᛂ䛧䛯㻌utf8mb4 䜢᥎ዡ㻌 18 © Copyright 2012 MyNA.
  19. 19. MySQL䛻䛿䛨䜑䛛䜙䛒䜛䝕䞊䝍䝧䞊䝇 MySQL䛻䛿䛒䜙䛛䛨䜑Ꮡᅾ䛩䜛䝕䞊䝍䝧䞊䝇䛜䛒䜛 • MySQL䛷䛿䚸䛒䜙䛛䛨䜑MySQL⮬㌟䛜౑⏝䛩䜛䝕䞊䝍䝧䞊䝇䛷䛒䜛 information_schema䚸mysql䛜Ꮡᅾ䚹䜎䛯䚸䝔䝇䝖⏝䝕䞊䝍䝧䞊䝇䛸䛧䛶䚸test 19 © Copyright 2012 MyNA.
  20. 20. MySQL䛾ᶒ㝈 MySQL䛻䛿䚸䝞䞊䝆䝵䞁䛻䜘䜛㐪䛔䛷 • MySQL䛷䛿䚸䝞䞊䝆䝵䞁䛻䜘䛳䛶䚸ᶒ㝈䛾✀㢮䛜㐪䛖 • 䝬䝙䝳䜰䝹䜢☜ㄆ䛧䜎䛧䜗䛖 20 © Copyright 2012 MyNA.
  21. 21. ᶆ‽䛸䛧䛶䛾SQL䛸⊂⮬ᣑᙇ䛾SQL㻌 MySQL䛻䜒䚸䛹䜣䛺䝕䞊䝍䝧䞊䝇䛻䜒 • SQL䛿䚸ANSI䠄䜰䝯䝸䜹つ᱁༠఍䠅䜔ISO䠄ᅜ㝿ᶆ‽໬ᶵᵓ䠅䛜つ᱁໬ • MySQL䛻䛚䛔䛶䜒䚸䛣䛾ᶆ‽SQL䜈䛾ᑐᛂ • MySQL 5.6䛻䛚䛡䜛ᶆ‽SQL䛸䛔䛖ሙྜ䛿䚸2003ᖺ䛻Ⓨ⾲䛥䜜䛯䛂SQL: 2003䛃䜢ព࿡ • MySQL䜢ྵ䜐ྛ䝸䝺䞊䝅䝵䝘䝹䝕䞊䝍䝧䞊䝇䛻䛿䚸⊂⮬ᣑᙇ䛜䛒䜛 – MySQL: AUTO_INCREMENT㻌䛺䛹 • Oracle䛺䜙䜀PL/SQL䚸SQL Server䛺䜙䜀Transcast-SQL䛸䛔䛳䛯䜘䛖䛻䚸䛭 䜜䛮䜜ᣑᙇ䛥䜜䛯⊂⮬䛾SQL䜢ᐇ⿦䛧䛶䛔䜎䛩䚹 21 © Copyright 2012 MyNA.
  22. 22. Ꮫ⩦⏝䛾䝃䞁䝥䝹䝕䞊䝍䝧䞊䝇䜢ά⏝䛧䜘䛖 MySQL䛷ᶆ‽㓄ᕸ • MySQL䛻䛿䚸䝃䞁䝥䝹䝕䞊䝍䝧䞊䝇䛸䛧䛶䚸world䛸sakila䛸䛔䛖2䛴䛾䝕䞊䝍 䝧䞊䝇䜢㓄ᕸ • world䝕䞊䝍䝧䞊䝇䠖䝣䜱䞁䝷䞁䝗䛾බᘧ⤫ィ䝕䞊䝍䜢ᥦ౪䛩䜛Statistics Finland 䛜ᥦ౪䛩䜛䝕䞊䝍䜢฼⏝䛧䛶䚸㛤Ⓨ䚹ᐇ㝿䛾ୡ⏺䛾㒔ᕷ䜔ᅜ䚸౑⏝䛥 䜜䛶䛔䜛ゝㄒ䛾᝟ሗ䛺䛹䛜᱁⣡䚹䛧䛛䛧䚸world䛻ྵ䜎䜜䛶䛔䜛䝕䞊䝍䛿䚸ⱝ ᖸྂ䛔䛯䜑䚸ேཱྀ䜔㒔ᕷྡ䛺䛹䛾᝟ሗ䛜᭱᪂䛾䜒䛾䛸䛿␗䛺䜛䚹౛䛘䜀䚸᪥ ᮏ䛾㒔ᕷ⤫ྜ䛿ධ䛳䛶䛔䛺䛔䛣䛸䛜ከ䛔䠄ᾆ࿴ᕷ䚸䛥䛔䛯䜎ᕷ䛺䛹䠅 • Sakila䠖Mike Hillyer Ặ䛜㛤Ⓨ䛧䛯䝕䞊䝍䝧䞊䝇䚹䝺䞁䝍䝹DVDᗑ䛾ၟရ䜔ྲྀ ᘬ䛾᝟ሗ䜢ྵ䜏䚸MySQL䛾ᶵ⬟䛷䛒䜛䝡䝳䞊䚸䝇䝖䜰䞊䝗䝥䝻䝅䞊䝆䝱䜔䝖䝸 䜺䞊䜢Ꮫ䜆䛯䜑䛻౑䛘䜛 22 © Copyright 2012 MyNA.
  23. 23. Ꮫ⩦⏝䛾䝃䞁䝥䝹䝕䞊䝍䝧䞊䝇䜢ά⏝䛧䜘䛖䠄䠎䠅 MySQL䛷ᶆ‽㓄ᕸ • 䝃䞁䝥䝹䝕䞊䝍䝧䞊䝇䜢ู㏵ධᡭ䛧䛯䛔ሙྜ䛿䚸 http://dev.mysql.com/doc/index-other.html 䛛䜙䝎䜴䞁䝻䞊䝗 • 䝃䜲䝖䛻䛿䚸䝃䞁䝥䝹䝕䞊䝍䝧䞊䝇䛸䛧䛶䚸world䛸sakila ௨እ䛻䚸employee 䛜䝎䜴䞁䝻䞊䝗ྍ⬟䛷䛩䚹employee䛿䚸䝺䝁䞊䝗䛜4୓௨ୖ䛒䜛⣙160MB䛾 䝕䞊䝍䜢ᣢ䛴኱䛝䛺䝕䞊䝍䝧䞊䝇 23 © Copyright 2012 MyNA.
  24. 24. STEP UP: ṇつ໬䜢䛝䛱䜣䛸ຮᙉ䛩䜛 䝕䞊䝍䝧䞊䝇䛾ᇶ♏ • ṇつ໬䛸䛿䚸䝕䞊䝍䛾㔜」䜢䛺䛟䛧ᩚྜⓗ䛻䝕䞊䝍䜢ྲྀ䜚ᢅ䛘䜛䜘䛖䛻䝕䞊䝍 䝧䞊䝇䜢タィ䛩䜛䛣䛸 • 䛴䜎䜚䚸䝕䞊䝍䛜㔜」䛧䛶䛔䜛䜘䛖䛺≧ែ䛾䜎䜎䛷䛿䚸෕㛗䛺䝕䞊䝍䛜Ⓨ⏕䛧 䜎䛩䚹䛭䛾䜘䛖䛺㔜」䛧䛯䝕䞊䝍䛜䚸」ᩘ䛾䝔䞊䝤䝹䛻Ꮡᅾ䛩䜛ሙྜ䛿䚸䛩䜉 䛶䛾䝔䞊䝤䝹䛷䝕䞊䝍䛜ᖖ䛻ྠ୍䛻䛺䜛䜘䛖䛻ኚ᭦䛩䜛ᚲせ • ṇつ໬䜢⾜䛳䛶䛚䛟䛸䚸䝕䞊䝍䛾㏣ຍ䞉᭦᪂䞉๐㝖䛺䛹䛻క䛖䝕䞊䝍䛾୙ᩚྜ䜔 ᾘኻ䛜㉳䛝䜛䛾䜢㜵䛞䚸䝯䞁䝔䝘䞁䝇䛾ຠ⋡䜢㧗䜑䜛䛣䛸䛜䛷䛝䜛 • ዟ㔝䛥䜣䛜slideshare䛻ṇつ໬䛻䛴䛔䛶䚸䜏䛳䛱䜚䛸䛧䛯ゎㄝ䜢䛧䛯㈨ᩱ䜢 䜰䝑䝥䝻䞊䝗䛧䛶䛔䜎䛩 24 © Copyright 2012 MyNA.
  25. 25. MySQL䛾㐠⏝䜒⪃䛘䛶䛚䛟 ồ䜑䜙䜜䜛▱㆑䛜㐪䛖 䜰䞊䜻䝔䜽䝖 ᇶ┙ᵓ⠏ 䜰䝥䝸㛤Ⓨ 㐠⏝ • 䝃䞊䝞䞊䚸䝇䝖䝺䞊䝆䚸䝛䝑䝖䝽䞊䜽䚸䝞䝑䜽䜰䝑䝥䠃䝸䜹䝞䝸㻌 䛺䛹䛾タィ䚸ᵓ⠏ • 䜰䝥䝸䜿䞊䝅䝵䞁㛤Ⓨ㻌(Web㛤Ⓨ䚸ᴗົ⣔㛤Ⓨ) • 㐠⏝䚸ಖᏲ 25 © Copyright 2012 MyNA.
  26. 26. 䝩䝑䝖䝞䝑䜽䜰䝑䝥䛸䝁䞊䝹䝗䝞䝑䜽䜰䝑䝥 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • 䝞䝑䜽䜰䝑䝥䜢ྲྀ䜛䛸䛝䛾䝕䞊䝍䝧䞊䝇䛾≧ែ䜢ᇶ‽䛻䛧䛶䚸䝕䞊䝍䝧䞊䝇䛾 䝞䝑䜽䜰䝑䝥䛻䛿䚸኱䛝䛟ศ䛡䛶䛂䝩䝑䝖䝞䝑䜽䜰䝑䝥䛃䛸䛂䝁䞊䝹䝗䝞䝑䜽䜰䝑䝥䛃 䛾2䛴 – 䝩䝑䝖䝞䝑䜽䜰䝑䝥 • 䝕䞊䝍䝧䞊䝇䜢೵Ṇ䛫䛪䛻㉳ື䛧䛯䜎䜎䛷ᐇ᪋䛩䜛䝞䝑䜽䜰䝑䝥䛾䛣䛸䚹䜸 䞁䝷䜲䞁䝞䝑䜽䜰䝑䝥䛸䜒࿧䜀䜜䜛䚹 – 䝁䞊䝹䝗䝞䝑䜽䜰䝑䝥 • 䝕䞊䝍䝧䞊䝇䜢䛩䜉䛶೵Ṇ䛧䛯≧ែ䛷⾜䛖䝞䝑䜽䜰䝑䝥䚹䜸䝣䝷䜲䞁䝞䝑䜽 䜰䝑䝥䛸䜒࿧䜀䜜䜛䚹 26 © Copyright 2012 MyNA.
  27. 27. ≀⌮䝞䝑䜽䜰䝑䝥䛸ㄽ⌮䝞䝑䜽䜰䝑䝥 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • ㄽ⌮䝞䝑䜽䜰䝑䝥 – mysqldump䛺䛹䛾䝕䞊䝍䝧䞊䝇䛜ᣢ䛳䛶䛔䜛䝁䝬䞁䝗䜢౑⏝䛧䛶䚸䝕䞊䝍 䝧䞊䝇䛻᱁⣡䛥䜜䛯䝕䞊䝍䜢ྲྀ䜚ฟ䛧䚸䝞䝑䜽䜰䝑䝥䛩䜛᪉ἲ䚹 – 䝕䞊䝍䝧䞊䝇䛾䝁䝬䞁䝗䜢฼⏝䛩䜛䛾䛷䚸ㄽ⌮䝞䝑䜽䜰䝑䝥䛿䝩䝑䝖䝞䝑䜽䜰䝑 䝥䚹 • ≀⌮䝞䝑䜽䜰䝑䝥 – 䝕䞊䝍䝧䞊䝇䜢ᵓᡂ䛩䜛䝣䜯䜲䝹䜢䛭䛾䜎䜎ಖᏑ䛩䜛䝞䝑䜽䜰䝑䝥䛩䜛᪉ἲ䚹 27 © Copyright 2012 MyNA.
  28. 28. 䝣䝹䝞䝑䜽䜰䝑䝥 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • 䛹䛾䜘䛖䛺䝕䞊䝍䜢䝞䝑䜽䜰䝑䝥䛩䜛䛛䛸䛔䛖ほⅬ䛛䜙䛿䚸䝣䝹䝞䝑䜽䜰䝑䝥䚸ᕪ ศ䝞䝑䜽䜰䝑䝥䚸ቑศ䝞䝑䜽䜰䝑䝥䛾䠄୺䛻䠅䚷3䛴䛾ศ㢮䛜䛒䜛 • 䝣䝹䝞䝑䜽䜰䝑䝥 – 䝣䝹䝞䝑䜽䜰䝑䝥䛿䚸䛩䜉䛶䛾䝣䜯䜲䝹䜢ẖᅇ䝞䝑䜽䜰䝑䝥䛩䜛᪉ἲ(౛䛘䜀䛻 ẖ㐌᪥᭙᪥䛾ኪ䛻ᐇ᪋)䚹䝸䝇䝖䜰䛩䜛䛸䛝䛿䚸᭱ᚋ䛻䝞䝑䜽䜰䝑䝥䜢ྲྀᚓ䛧 䛯䝣䜯䜲䝹䛛䜙᚟ඖ(ẖ᪥ᐇ᪋䛧䛶䛔䜛䛺䜙䜀๓᪥䛾䝣䜯䜲䝹)䚹㠀ᖖ䛻䝅䞁䝥 䝹䛺᪉ἲ䛾䛯䜑䚸᚟ᪧ䛩䜛ᡭ㛫䜒᫬㛫䜒▷䛟䛺䜛 – 䛧䛛䛧䚸䝞䝑䜽䜰䝑䝥䝕䞊䝍䛜኱䛝䛟䛺䜛䛸䚸䝣䝹䝞䝑䜽䜰䝑䝥䛻ᚲせ䛺᫬㛫䛜 㛗䛟䛺䜚䜎䛩䚹䛭䛧䛶䚸౛䛘䜀䚸᭶᭙᪥䛛䜙᪥᭙᪥䜎䛷ẖ᪥䝞䝑䜽䜰䝑䝥䝕䞊 䝍䜢ಖᏑ䛩䜛䜘䛖䛺ሙྜ䛿䚸኱㔞䛾䝔䞊䝥䜔኱ᐜ㔞䛾䝇䝖䝺䞊䝆䛜ᚲせ 㻌 28 © Copyright 2012 MyNA.
  29. 29. ᕪศ䝞䝑䜽䜰䝑䝥 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • ᭱ึ䛾୍ᅇ䛿䝣䝹䝞䝑䜽䜰䝑䝥䜢ᐇ᪋䛧䛶䚸䛭䛾䛒䛸䛿䚸ᕪศ(ኚ᭦䛧䛯㒊ศ) 䝞䝑䜽䜰䝑䝥䛩䜛᪉ἲ䚹 • 䝕䞊䝍䜢䝸䝇䝖䜰䛩䜛䛸䛝䛻䛿䚸䜎䛪䝣䝹䝞䝑䜽䜰䝑䝥䛧䛯䝣䜯䜲䝹䜢᚟ඖ䛧䛶䚸 ḟ䛻᭱᪂䛾ᕪศ䝞䝑䜽䜰䝑䝥䜢᚟ඖ䚹 • ౛䛘䜀䚸᭶᭙᪥䛻㝆䜚䝞䝑䜽䜰䝑䝥䜢䛸䛳䛶䚸ẖ᪥ᕪศ䝞䝑䜽䜰䝑䝥䜢ྲྀ䛳䛶䛔 䜛ሙྜ䚸㔠᭙᪥䛻䝅䝇䝔䝮㞀ᐖ䛜Ⓨ⏕䛩䜛䛸䚸᚟ᪧ䛩䜛䛻䛿䚸᭶᭙᪥䛻ྲྀᚓ 䛧䛯䝣䝹䝞䝑䜽䜰䝑䝥䛾䝕䞊䝍䜢᚟ඖ䛧䛶䛛䜙䚸᭱᪂䛾ᕪศ䝞䝑䜽䜰䝑䝥䛷䛒䜛 ᮌ᭙᪥䛾䝕䞊䝍䜢᚟ඖ䛩䜛 • ᕪศ䝞䝑䜽䜰䝑䝥䛿䚸䝣䝹䝞䝑䜽䜰䝑䝥䜘䜚䜒඲య䛾䝞䝑䜽䜰䝑䝥䝕䞊䝍㔞䛿ᑡ 䛺䛟䛶䛩䜏䚸䝞䝑䜽䜰䝑䝥᫬㛫䜒▷䛟䛺䜚䜎䛩䚹䝸䝇䝖䜰䛾ᡭ㛫䜒ḟ䛻ㄝ᫂䛩䜛 ቑศ䝞䝑䜽䜰䝑䝥䜘䜚䜒⡆༢䛷䛩䚹㻌 29 © Copyright 2012 MyNA.
  30. 30. ᕪศ䝞䝑䜽䜰䝑䝥 䝣䝹䝞䝑䜽䜰䝑䝥 ᪥㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌᭶㻌㻌㻌㻌㻌㻌㻌㻌ⅆ㻌㻌㻌㻌㻌㻌㻌㻌㻌Ỉ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌ᮌ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌㔠㻌㻌㻌㻌㻌㻌㻌㻌ᅵ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌 30 © Copyright 2012 MyNA. ᕪศ䝞䝑䜽䜰䝑䝥
  31. 31. ቑศ䝞䝑䜽䜰䝑䝥 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • ቑศ䝞䝑䜽䜰䝑䝥䛿䚸๓ᅇ䛾䝞䝑䜽䜰䝑䝥௨㝆䛻ኚ᭦䛥䜜䛯䝣䜯䜲䝹䛰䛡䜢䝞䝑 䜽䜰䝑䝥䛩䜛᪉ἲ • 䝕䞊䝍䜢䝸䝇䝖䜰䛩䜛䛸䛝䛻䛿䚸䜎䛪䝣䝹䝞䝑䜽䜰䝑䝥䛧䛯䝣䜯䜲䝹䜢᚟ඖ䛧䛶䚸 ḟ䛻ᕪศ䝞䝑䜽䜰䝑䝥䛥䜜䛯䝣䜯䜲䝹䜢᭱᪂䛾䜒䛾䜎䛷㡰␒䛻᚟ඖ䚹 • 䛥䛝䜋䛹䛾౛䜢౑䛖䛸䚸㔠᭙᪥䛻䝅䝇䝔䝮㞀ᐖ䛜Ⓨ⏕䛧䛯ሙྜ䚸᚟ᪧ䛩䜛䛻䛿䚸 ᭶᭙᪥䛻ྲྀᚓ䛧䛯䝣䝹䝞䝑䜽䜰䝑䝥䛾䝕䞊䝍䜢᚟ඖ䛧䛶䛛䜙䚸ⅆ᭙᪥䛛䜙᭱᪂ 䛾ᕪศ䝞䝑䜽䜰䝑䝥䛷䛒䜛ᮌ᭙᪥䛾䝕䞊䝍䜢᚟ඖ • ቑศ䝞䝑䜽䜰䝑䝥䛿䚸䝣䝹䝞䝑䜽䜰䝑䝥䜘䜚䜒඲య䛾䝞䝑䜽䜰䝑䝥䝕䞊䝍㔞䛿ᑡ 䛺䛟䛶䛩䜏䚸䝞䝑䜽䜰䝑䝥᫬㛫䜒3䛴䛾୰䛷䛿୍␒▷䛟䛺䜛䚹䛧䛛䛧䚸䝸䝇䝖䜰䛻 ౑⏝䛩䜛䝞䝑䜽䜰䝑䝥䝕䞊䝍䛜ከᩘ䛻䛺䜛䛯䜑䚸᚟ᪧ᫬䛾ᡭ㛫䛜䛛䛛䜚䚸᫬㛫 䜒㛗䛟䛛䛛䜛 31 © Copyright 2012 MyNA.
  32. 32. ቑศ䝞䝑䜽䜰䝑䝥 䝣䝹䝞䝑䜽䜰䝑䝥 ᪥㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌᭶㻌㻌㻌㻌㻌㻌㻌㻌ⅆ㻌㻌㻌㻌㻌㻌㻌㻌㻌Ỉ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌ᮌ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌㔠㻌㻌㻌㻌㻌㻌㻌㻌ᅵ㻌㻌㻌㻌㻌㻌㻌㻌㻌㻌 32 © Copyright 2012 MyNA. ቑศ䝞䝑䜽䜰䝑䝥
  33. 33. 㻹ySQL䛾䝞䝑䜽䜰䝑䝥᪉ἲ 䝞䝑䜽䜰䝑䝥䛾ᇶ♏ • MySQL䛾ᶆ‽ᶵ⬟䛷䛒䜛 – mysqdump – 䝺䝥䝸䜿䞊䝅䝵䞁䜢฼⏝䛩䜛᪉ἲ • OS䛾䝁䝢䞊䝁䝬䞁䝗䛺䛹䜢฼⏝䛩䜛᪉ἲ • MySQL Enterprise Backup䛾䜘䛖䛺᭷ൾ䛾䝋䝣䝖䜴䜵䜰䜢฼⏝䛩䜛᪉ἲ • 䝇䝖䝺䞊䝆〇ရ䛾䝇䝘䝑䝥䝅䝵䝑䝖䛺䛹䜢฼⏝䛩䜛᪉ἲ䛺䛹 33 © Copyright 2012 MyNA.
  34. 34. 䝞䝑䜽䜰䝑䝥䛾ὀពⅬ 䝕䞊䝍䛜ቑຍ䛧䛶䜒䚸䝞䝑䜽䜰䝑䝥䛻౑䛘䜛᫬㛫䛿ቑຍ䛧䛺䛔 • ື⏬䜔⏬ീ䛺䛹䛾䛥䜎䛦䜎䛺䝁䞁䝔䞁䝒→䝕䞊䝍䛜ᛴቑ䚹 • ௬᝿໬䝔䜽䝜䝻䝆䞊䛷䚸୍ྎ䛻䛯䛟䛥䜣䛾OS→䝕䞊䝍䛜ᛴቑ • 䝞䝑䜽䜰䝑䝥䜢ᐇ᪋䛩䜛ሙྜ䛿䚸௨๓䛿䚸䜰䜽䝉䝇䛾ᑡ䛺䛔ኪ㛫䜔㐌ᮎ䜢฼⏝䚹 䝕䞊䝍㔞䛜ᑡ䛺䛔ሙྜ䛻䛿䚸௒䜎䛷㏻䜚䝔䞊䝥䜢ά⏝䛧䛯䝞䝑䜽䜰䝑䝥䜢ᐇ᪋ 䛧䛶䛔䜜䜀䜘䛛䛳䛯䛾䛷䛩䛜䚸䝔䞊䝥䛷䛿ணᐃ᫬㛫ෆ䛻䝞䝑䜽䜰䝑䝥䛜⤊஢䛧 䛺䛔䛸䛔䛳䛯≧ἣ • ௒䚸ᛴ㏿䛻ᑟධ䛜ᗈ䛜䛳䛶䛔䜛᪉ἲ䛿䚸䝝䞊䝗䝕䜱䝇䜽䜔༙ᑟయ䝕䜱䝇䜽䜢ᦚ ㍕䛧䛯䝇䝖䝺䞊䝆䜢฼⏝䛧䛯䝞䝑䜽䜰䝑䝥䛾฼⏝䚹 • 䝔䞊䝥䝗䝷䜲䝤䜘䜚䜒䚸䛭䜜䜙䛾䝇䝖䝺䞊䝆䛿᭩䛝㎸䜏䛾㏿ᗘ䛜㏿䛟䚸䜎䛯ྠ᫬ 䛻」ᩘ䛾䝅䝇䝔䝮䛾䜶䞊䝍䜢᭩䛝㎸䜐䛣䛸䛜䛷䛝䜛䛯䜑䚸ຠ⋡ⓗ䛺䝞䝑䜽䜰䝑 䝥䛜ྍ⬟㻌(D2D2T䛸䛔䛖䜔䜚䛛䛯䜒䛒䜛䠅 34 © Copyright 2012 MyNA.
  35. 35. © Copyright 2012 MyNA.

×