From f132a2db886bbbe35054970fced294eff4081b23 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Wed, 15 Jan 2025 10:04:14 +0100 Subject: [PATCH] Update scrapegraph_langgraph_tavily_my_sql.ipynb --- .../scrapegraph_langgraph_tavily_my_sql.ipynb | 533 +++++++++++++----- 1 file changed, 402 insertions(+), 131 deletions(-) diff --git a/cookbook/research-agent/scrapegraph_langgraph_tavily_my_sql.ipynb b/cookbook/research-agent/scrapegraph_langgraph_tavily_my_sql.ipynb index cfe1fca..0572567 100644 --- a/cookbook/research-agent/scrapegraph_langgraph_tavily_my_sql.ipynb +++ b/cookbook/research-agent/scrapegraph_langgraph_tavily_my_sql.ipynb @@ -6,7 +6,7 @@ "id": "ReBHQ5_834pZ" }, "source": [ - "\n", + "\n", " \"Open\n", "" ] @@ -70,15 +70,28 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "sffqFG2EJ8bI", - "outputId": "7e47aa4d-edca-48f2-df6e-bd7fafabfc9c" + "outputId": "9eefeb7d-d2cf-484c-b5cb-d73a5aa5e261" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Scrapegraph API key:\n", + "··········\n", + "Tavily API key:\n", + "··········\n", + "OpenAI API key:\n", + "··········\n" + ] + } + ], "source": [ "import getpass\n", "import os\n", @@ -186,7 +199,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "id": "dlrOEgZk_8V4" }, @@ -232,7 +245,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "id": "ySoE0Rowjgp1" }, @@ -270,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": { "id": "ctrkEnltiBCD" }, @@ -296,7 +309,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": { "id": "Zo1BcIlHhcQP" }, @@ -333,14 +346,14 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 350 }, "id": "2FIKomclLNFx", - "outputId": "3419b941-b409-499e-c1e3-54f2526d467f" + "outputId": "9958e65d-9796-4f24-fd3f-12cc55532a2f" }, "outputs": [ { @@ -373,13 +386,13 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Qn1rC2y8kAe9", - "outputId": "15438700-b5ac-4439-b3b5-661de0bfef7c" + "outputId": "1865f1ea-7241-40de-85e5-3743acf222cb" }, "outputs": [ { @@ -388,28 +401,28 @@ "text": [ "================================\u001b[1m Human Message \u001b[0m=================================\n", "\n", - "Find latest news related to robotics December 2024\n", + "Find latest news related to robotics January 2025\n", "==================================\u001b[1m Ai Message \u001b[0m==================================\n", "Tool Calls:\n", - " urls_finder (call_oUmqKXOoRQQAmXlB3lZL6ZNx)\n", - " Call ID: call_oUmqKXOoRQQAmXlB3lZL6ZNx\n", + " urls_finder (call_MIc1FV1MLRIv9QqGzepHKeUD)\n", + " Call ID: call_MIc1FV1MLRIv9QqGzepHKeUD\n", " Args:\n", - " query: latest robotics news December 2024\n", + " query: latest robotics news January 2025\n", "=================================\u001b[1m Tool Message \u001b[0m=================================\n", "Name: urls_finder\n", "\n", - "[{\"url\": \"https://www.therobotreport.com/top-10-robotics-stories-of-december-2024/\", \"content\": \"AMP Robotics raised $91 million in corporate equity in a Series D financing in December 2024. The Louisville, Colo.-based company plans to use its latest funding to accelerate deployment of its AMP ONE systems, which uses artificial intelligence and robotics to sort municipal solid waste, or MSW. Read more.\"}]\n", + "[{\"url\": \"https://www.sciencedaily.com/news/computers_math/robotics/\", \"content\": \"Read up-to-date robotics news from research institutions around the world. ... Jan. 8, 2025 — Facing high ... Keep up to date with the latest news from ScienceDaily via social networks:\"}]\n", "==================================\u001b[1m Ai Message \u001b[0m==================================\n", "Tool Calls:\n", - " SmartScraper (call_xVtyeAQeaW6F4mOQAW13tset)\n", - " Call ID: call_xVtyeAQeaW6F4mOQAW13tset\n", + " SmartScraper (call_iAelivYCYBqwvaxSEaI61QMx)\n", + " Call ID: call_iAelivYCYBqwvaxSEaI61QMx\n", " Args:\n", - " user_prompt: Extract the key news stories related to robotics from December 2024, including any significant events, advancements, or company news.\n", - " website_url: https://www.therobotreport.com/top-10-robotics-stories-of-december-2024/\n", + " user_prompt: Extract the latest news headlines and summaries related to robotics from January 2025.\n", + " website_url: https://www.sciencedaily.com/news/computers_math/robotics/\n", "=================================\u001b[1m Tool Message \u001b[0m=================================\n", "Name: SmartScraper\n", "\n", - "{\"news\": [{\"title\": \"Huawei invests $413M into robotics subsidiary\", \"link\": \"https://www.therobotreport.com/huawei-invests-413m-into-robotics-subsidiary/\", \"description\": \"Huawei Technologies invested 3 billion yuan (about $413 million) into its subsidiary Dongguan Jimu Machinery, which was established in June 2023.\"}, {\"title\": \"Interact Analysis downgrades mobile robot forecast by 18%\", \"link\": \"https://www.therobotreport.com/interact-analysis-downgrades-mobile-robot-forecast-by-18/\", \"description\": \"The research firm reduced its forecast for the global mobile robot market due to macroeconomic factors affecting demand, expecting no rapid uptick in autonomous mobile robot deployments before 2027.\"}, {\"title\": \"AMP Robotics raises $91M to accelerate deployment of recycling systems\", \"link\": \"https://www.therobotreport.com/amp-robotics-raises-91m-accelerate-deployment-recycling-systems/\", \"description\": \"AMP Robotics raised $91 million in Series D financing to enhance the deployment of its AMP ONE systems, which utilize AI and robotics for sorting municipal solid waste.\"}, {\"title\": \"Microbot Medical submits LIBERTY surgical robot to FDA for approval\", \"link\": \"https://www.therobotreport.com/microbot-medical-submits-liberty-surgical-robot-to-fda-for-approval/\", \"description\": \"Microbot Medical submitted a premarket notification to the FDA for its LIBERTY robotic system, expecting clearance in the second quarter of 2025.\"}, {\"title\": \"Realbotix earns Amazon development subsidy; partners with UOL\", \"link\": \"https://www.therobotreport.com/realbotix-earns-amazon-development-subsidy-partners-with-uol/\", \"description\": \"Realbotix Corp. announced a $100,000 subsidy from Amazon Web Services and a partnership with Compass UOL, along with updates to its Aria offering.\"}, {\"title\": \"Jetson Orin Nano Super developer kit available from NVIDIA\", \"link\": \"https://www.therobotreport.com/jetson-orin-nano-super-developer-kit-available/\", \"description\": \"NVIDIA released the Jetson Orin Nano Super Developer Kit, enhancing AI workload performance significantly while maintaining low power consumption.\"}, {\"title\": \"Pudu Robotics launches PUDU D9 humanoid robot\", \"link\": \"https://www.therobotreport.com/pudu-d9-humanoid-robot-launched/\", \"description\": \"Pudu Technology Inc. unveiled its first full-sized bipedal humanoid robot, the PUDU D9, aimed at commercially viable embodied intelligence.\"}, {\"title\": \"EngineAI releases PM01 humanoid robot for commercial, educational use\", \"link\": \"https://www.therobotreport.com/engineai-releases-pm01-humanoid-robot-for-commercial-educational-use/\", \"description\": \"EngineAI Robotics introduced the PM01, a lightweight and dynamic humanoid robot designed for commercial and educational applications.\"}, {\"title\": \"Apptronik partners with Google DeepMind to advance humanoid robots with AI\", \"link\": \"https://www.therobotreport.com/apptronik-partners-google-deepmind-advance-humanoid-robots-ai/\", \"description\": \"Apptronik has formed a strategic partnership with Google DeepMind to integrate AI with robotics hardware for enhanced humanoid capabilities.\"}, {\"title\": \"Figure AI ships Figure 02 humanoid robots to a paying customer\", \"link\": \"https://www.therobotreport.com/figure-ai-ships-figure-02-humanoid-robots-to-a-paying-customer/\", \"description\": \"Figure AI has begun shipping its Figure 02 humanoid robots, marking a shift from development to commercial use.\"}, {\"title\": \"Figure AI Delivers Figure 02 Humanoid Robots to Commercial Client\", \"link\": \"https://www.therobotreport.com/figure-ai-ships-figure-02-humanoid-robots-paying-customer/\", \"description\": \"In December 2024, Figure AI announced the delivery of its Figure 02 humanoid robots to a commercial client, marking the company's transition to a revenue-generating status.\"}]}\n" + "{\"news\": [{\"title\": \"Using Robots in Nursing Homes Linked to Higher Employee Retention, Better Patient Care\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250108173155.htm\", \"description\": \"Nursing homes are increasingly utilizing robots for various care tasks to address high employee turnover and an aging population, although research on the impact of these technologies is limited. A study indicates that the integration of robots in nursing homes is associated with improved employee retention rates and enhanced patient care quality.\"}, {\"title\": \"Electrohydraulic Wearable Devices Create Unprecedented Haptic Sensations\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250108144220.htm\", \"description\": \"Scientists have developed compact wearable devices that provide rich and expressive tactile sensations, surpassing the basic vibrations of current consumer devices. New advancements in electrohydraulic wearable technology are reported to produce unique haptic sensations, enhancing user interaction with robotic systems.\"}, {\"title\": \"Artificial Intelligence: Algorithms Improve Medical Image Analysis\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250102162630.htm\", \"description\": \"AI has the potential to enhance the analysis of medical images, with deep learning algorithms capable of identifying tumor locations and sizes.\"}, {\"title\": \"DNA Nanorobots Can Alter Artificial Cells\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250113134758.htm\", \"description\": \"Research reveals that DNA nanorobots have the capability to modify artificial cells, showcasing potential applications in biotechnology and medicine.\"}, {\"title\": \"A Smart Ring With a Tiny Camera Lets Users Point and Click to Control Home Devices\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250109130038.htm\", \"description\": \"This innovative smart ring features a miniature camera that allows users to control various home devices through simple point-and-click actions.\"}, {\"title\": \"Advancements in Neural Implant Research Enhance Durability\", \"link\": \"https://www.sciencedaily.com/releases/2025/01/250107140908.htm\", \"description\": \"Recent research in neural implants has led to improvements in their durability, which could significantly impact the field of robotics and human-machine interfaces.\"}]}\n" ] } ], @@ -424,7 +437,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": { "id": "_12IqhcrkiHC" }, @@ -449,13 +462,13 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "F1VfD8B4LPc8", - "outputId": "3aebeb27-c529-4bd6-e3a4-6318f9dabc0b" + "outputId": "9ddc9298-8295-4efa-f66f-e381b75aa793" }, "outputs": [ { @@ -465,59 +478,34 @@ "{\n", " \"news\": [\n", " {\n", - " \"title\": \"Huawei invests $413M into robotics subsidiary\",\n", - " \"link\": \"https://www.therobotreport.com/huawei-invests-413m-into-robotics-subsidiary/\",\n", - " \"description\": \"Huawei Technologies invested 3 billion yuan (about $413 million) into its subsidiary Dongguan Jimu Machinery, which was established in June 2023.\"\n", - " },\n", - " {\n", - " \"title\": \"Interact Analysis downgrades mobile robot forecast by 18%\",\n", - " \"link\": \"https://www.therobotreport.com/interact-analysis-downgrades-mobile-robot-forecast-by-18/\",\n", - " \"description\": \"The research firm reduced its forecast for the global mobile robot market due to macroeconomic factors affecting demand, expecting no rapid uptick in autonomous mobile robot deployments before 2027.\"\n", - " },\n", - " {\n", - " \"title\": \"AMP Robotics raises $91M to accelerate deployment of recycling systems\",\n", - " \"link\": \"https://www.therobotreport.com/amp-robotics-raises-91m-accelerate-deployment-recycling-systems/\",\n", - " \"description\": \"AMP Robotics raised $91 million in Series D financing to enhance the deployment of its AMP ONE systems, which utilize AI and robotics for sorting municipal solid waste.\"\n", - " },\n", - " {\n", - " \"title\": \"Microbot Medical submits LIBERTY surgical robot to FDA for approval\",\n", - " \"link\": \"https://www.therobotreport.com/microbot-medical-submits-liberty-surgical-robot-to-fda-for-approval/\",\n", - " \"description\": \"Microbot Medical submitted a premarket notification to the FDA for its LIBERTY robotic system, expecting clearance in the second quarter of 2025.\"\n", - " },\n", - " {\n", - " \"title\": \"Realbotix earns Amazon development subsidy; partners with UOL\",\n", - " \"link\": \"https://www.therobotreport.com/realbotix-earns-amazon-development-subsidy-partners-with-uol/\",\n", - " \"description\": \"Realbotix Corp. announced a $100,000 subsidy from Amazon Web Services and a partnership with Compass UOL, along with updates to its Aria offering.\"\n", - " },\n", - " {\n", - " \"title\": \"Jetson Orin Nano Super developer kit available from NVIDIA\",\n", - " \"link\": \"https://www.therobotreport.com/jetson-orin-nano-super-developer-kit-available/\",\n", - " \"description\": \"NVIDIA released the Jetson Orin Nano Super Developer Kit, enhancing AI workload performance significantly while maintaining low power consumption.\"\n", + " \"title\": \"Using Robots in Nursing Homes Linked to Higher Employee Retention, Better Patient Care\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250108173155.htm\",\n", + " \"description\": \"Nursing homes are increasingly utilizing robots for various care tasks to address high employee turnover and an aging population, although research on the impact of these technologies is limited. A study indicates that the integration of robots in nursing homes is associated with improved employee retention rates and enhanced patient care quality.\"\n", " },\n", " {\n", - " \"title\": \"Pudu Robotics launches PUDU D9 humanoid robot\",\n", - " \"link\": \"https://www.therobotreport.com/pudu-d9-humanoid-robot-launched/\",\n", - " \"description\": \"Pudu Technology Inc. unveiled its first full-sized bipedal humanoid robot, the PUDU D9, aimed at commercially viable embodied intelligence.\"\n", + " \"title\": \"Electrohydraulic Wearable Devices Create Unprecedented Haptic Sensations\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250108144220.htm\",\n", + " \"description\": \"Scientists have developed compact wearable devices that provide rich and expressive tactile sensations, surpassing the basic vibrations of current consumer devices. New advancements in electrohydraulic wearable technology are reported to produce unique haptic sensations, enhancing user interaction with robotic systems.\"\n", " },\n", " {\n", - " \"title\": \"EngineAI releases PM01 humanoid robot for commercial, educational use\",\n", - " \"link\": \"https://www.therobotreport.com/engineai-releases-pm01-humanoid-robot-for-commercial-educational-use/\",\n", - " \"description\": \"EngineAI Robotics introduced the PM01, a lightweight and dynamic humanoid robot designed for commercial and educational applications.\"\n", + " \"title\": \"Artificial Intelligence: Algorithms Improve Medical Image Analysis\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250102162630.htm\",\n", + " \"description\": \"AI has the potential to enhance the analysis of medical images, with deep learning algorithms capable of identifying tumor locations and sizes.\"\n", " },\n", " {\n", - " \"title\": \"Apptronik partners with Google DeepMind to advance humanoid robots with AI\",\n", - " \"link\": \"https://www.therobotreport.com/apptronik-partners-google-deepmind-advance-humanoid-robots-ai/\",\n", - " \"description\": \"Apptronik has formed a strategic partnership with Google DeepMind to integrate AI with robotics hardware for enhanced humanoid capabilities.\"\n", + " \"title\": \"DNA Nanorobots Can Alter Artificial Cells\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250113134758.htm\",\n", + " \"description\": \"Research reveals that DNA nanorobots have the capability to modify artificial cells, showcasing potential applications in biotechnology and medicine.\"\n", " },\n", " {\n", - " \"title\": \"Figure AI ships Figure 02 humanoid robots to a paying customer\",\n", - " \"link\": \"https://www.therobotreport.com/figure-ai-ships-figure-02-humanoid-robots-to-a-paying-customer/\",\n", - " \"description\": \"Figure AI has begun shipping its Figure 02 humanoid robots, marking a shift from development to commercial use.\"\n", + " \"title\": \"A Smart Ring With a Tiny Camera Lets Users Point and Click to Control Home Devices\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250109130038.htm\",\n", + " \"description\": \"This innovative smart ring features a miniature camera that allows users to control various home devices through simple point-and-click actions.\"\n", " },\n", " {\n", - " \"title\": \"Figure AI Delivers Figure 02 Humanoid Robots to Commercial Client\",\n", - " \"link\": \"https://www.therobotreport.com/figure-ai-ships-figure-02-humanoid-robots-paying-customer/\",\n", - " \"description\": \"In December 2024, Figure AI announced the delivery of its Figure 02 humanoid robots to a commercial client, marking the company's transition to a revenue-generating status.\"\n", + " \"title\": \"Advancements in Neural Implant Research Enhance Durability\",\n", + " \"link\": \"https://www.sciencedaily.com/releases/2025/01/250107140908.htm\",\n", + " \"description\": \"Recent research in neural implants has led to improvements in their durability, which could significantly impact the field of robotics and human-machine interfaces.\"\n", " }\n", " ]\n", "}\n" @@ -530,24 +518,32 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "id": "S8s1AvWJKNaV" + }, "source": [ "## Save output inside a My-SQL db" ] }, { "cell_type": "code", - "execution_count": 12, - "metadata": {}, + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "123NhcIYKNaW", + "outputId": "c796a664-b201-4a18-dc10-9954b4a31107" + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Collecting mysql-connector-python\n", - " Downloading mysql_connector_python-9.1.0-cp313-cp313-macosx_13_0_arm64.whl.metadata (6.0 kB)\n", - "Downloading mysql_connector_python-9.1.0-cp313-cp313-macosx_13_0_arm64.whl (15.1 MB)\n", - "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m15.1/15.1 MB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n", + " Downloading mysql_connector_python-9.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (6.0 kB)\n", + "Downloading mysql_connector_python-9.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (34.4 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m34.4/34.4 MB\u001b[0m \u001b[31m35.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: mysql-connector-python\n", "Successfully installed mysql-connector-python-9.1.0\n" ] @@ -559,89 +555,335 @@ }, { "cell_type": "code", - "execution_count": 21, - "metadata": {}, + "execution_count": 12, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "R3tflfTDKNaW", + "outputId": "9c2ad012-610e-4714-ef8a-f614981c976d" + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\u001b[33mWarning:\u001b[0m mysql 9.1.0_1 is already installed and up-to-date.\n", - "To reinstall 9.1.0_1, run:\n", - " brew reinstall mysql\n" + "Reading package lists... Done\n", + "Building dependency tree... Done\n", + "Reading state information... Done\n", + "The following additional packages will be installed:\n", + " libcgi-fast-perl libcgi-pm-perl libclone-perl libencode-locale-perl libfcgi-bin libfcgi-perl\n", + " libfcgi0ldbl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl\n", + " libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmecab2 libprotobuf-lite23\n", + " liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0\n", + " mysql-server-8.0 mysql-server-core-8.0\n", + "Suggested packages:\n", + " libdata-dump-perl libipc-sharedcache-perl libbusiness-isbn-perl libwww-perl mailx tinyca\n", + "The following NEW packages will be installed:\n", + " libcgi-fast-perl libcgi-pm-perl libclone-perl libencode-locale-perl libfcgi-bin libfcgi-perl\n", + " libfcgi0ldbl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl\n", + " libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmecab2 libprotobuf-lite23\n", + " liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0\n", + " mysql-server mysql-server-8.0 mysql-server-core-8.0\n", + "0 upgraded, 25 newly installed, 0 to remove and 49 not upgraded.\n", + "Need to get 29.6 MB of archives.\n", + "After this operation, 243 MB of additional disk space will be used.\n", + "Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mysql-client-core-8.0 amd64 8.0.40-0ubuntu0.22.04.1 [2,715 kB]\n", + "Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mysql-client-8.0 amd64 8.0.40-0ubuntu0.22.04.1 [22.7 kB]\n", + "Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 libmecab2 amd64 0.996-14build9 [199 kB]\n", + "Get:4 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libprotobuf-lite23 amd64 3.12.4-1ubuntu7.22.04.1 [209 kB]\n", + "Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mysql-server-core-8.0 amd64 8.0.40-0ubuntu0.22.04.1 [17.6 MB]\n", + "Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mysql-server-8.0 amd64 8.0.40-0ubuntu0.22.04.1 [1,441 kB]\n", + "Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 libhtml-tagset-perl all 3.20-4 [12.5 kB]\n", + "Get:8 http://archive.ubuntu.com/ubuntu jammy/main amd64 liburi-perl all 5.10-1 [78.8 kB]\n", + "Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 libhtml-parser-perl amd64 3.76-1build2 [88.4 kB]\n", + "Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcgi-pm-perl all 4.54-1 [188 kB]\n", + "Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 libfcgi0ldbl amd64 2.4.2-2build2 [28.0 kB]\n", + "Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 libfcgi-perl amd64 0.82+ds-1build1 [22.8 kB]\n", + "Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 libcgi-fast-perl all 1:2.15-1 [10.5 kB]\n", + "Get:14 http://archive.ubuntu.com/ubuntu jammy/main amd64 libclone-perl amd64 0.45-1build3 [11.0 kB]\n", + "Get:15 http://archive.ubuntu.com/ubuntu jammy/main amd64 libencode-locale-perl all 1.05-1.1 [11.8 kB]\n", + "Get:16 http://archive.ubuntu.com/ubuntu jammy/main amd64 libfcgi-bin amd64 2.4.2-2build2 [11.2 kB]\n", + "Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 libhtml-template-perl all 2.97-1.1 [59.1 kB]\n", + "Get:18 http://archive.ubuntu.com/ubuntu jammy/main amd64 libhttp-date-perl all 6.05-1 [9,920 B]\n", + "Get:19 http://archive.ubuntu.com/ubuntu jammy/main amd64 libio-html-perl all 1.004-2 [15.4 kB]\n", + "Get:20 http://archive.ubuntu.com/ubuntu jammy/main amd64 liblwp-mediatypes-perl all 6.04-1 [19.5 kB]\n", + "Get:21 http://archive.ubuntu.com/ubuntu jammy/main amd64 libhttp-message-perl all 6.36-1 [76.8 kB]\n", + "Get:22 http://archive.ubuntu.com/ubuntu jammy/main amd64 mecab-utils amd64 0.996-14build9 [4,850 B]\n", + "Get:23 http://archive.ubuntu.com/ubuntu jammy/main amd64 mecab-ipadic all 2.7.0-20070801+main-3 [6,718 kB]\n", + "Get:24 http://archive.ubuntu.com/ubuntu jammy/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-3 [4,384 B]\n", + "Get:25 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 mysql-server all 8.0.40-0ubuntu0.22.04.1 [9,464 B]\n", + "Fetched 29.6 MB in 1s (27.0 MB/s)\n", + "Preconfiguring packages ...\n", + "Selecting previously unselected package mysql-client-core-8.0.\n", + "(Reading database ... 123632 files and directories currently installed.)\n", + "Preparing to unpack .../00-mysql-client-core-8.0_8.0.40-0ubuntu0.22.04.1_amd64.deb ...\n", + "Unpacking mysql-client-core-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Selecting previously unselected package mysql-client-8.0.\n", + "Preparing to unpack .../01-mysql-client-8.0_8.0.40-0ubuntu0.22.04.1_amd64.deb ...\n", + "Unpacking mysql-client-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Selecting previously unselected package libmecab2:amd64.\n", + "Preparing to unpack .../02-libmecab2_0.996-14build9_amd64.deb ...\n", + "Unpacking libmecab2:amd64 (0.996-14build9) ...\n", + "Selecting previously unselected package libprotobuf-lite23:amd64.\n", + "Preparing to unpack .../03-libprotobuf-lite23_3.12.4-1ubuntu7.22.04.1_amd64.deb ...\n", + "Unpacking libprotobuf-lite23:amd64 (3.12.4-1ubuntu7.22.04.1) ...\n", + "Selecting previously unselected package mysql-server-core-8.0.\n", + "Preparing to unpack .../04-mysql-server-core-8.0_8.0.40-0ubuntu0.22.04.1_amd64.deb ...\n", + "Unpacking mysql-server-core-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Selecting previously unselected package mysql-server-8.0.\n", + "Preparing to unpack .../05-mysql-server-8.0_8.0.40-0ubuntu0.22.04.1_amd64.deb ...\n", + "Unpacking mysql-server-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Selecting previously unselected package libhtml-tagset-perl.\n", + "Preparing to unpack .../06-libhtml-tagset-perl_3.20-4_all.deb ...\n", + "Unpacking libhtml-tagset-perl (3.20-4) ...\n", + "Selecting previously unselected package liburi-perl.\n", + "Preparing to unpack .../07-liburi-perl_5.10-1_all.deb ...\n", + "Unpacking liburi-perl (5.10-1) ...\n", + "Selecting previously unselected package libhtml-parser-perl:amd64.\n", + "Preparing to unpack .../08-libhtml-parser-perl_3.76-1build2_amd64.deb ...\n", + "Unpacking libhtml-parser-perl:amd64 (3.76-1build2) ...\n", + "Selecting previously unselected package libcgi-pm-perl.\n", + "Preparing to unpack .../09-libcgi-pm-perl_4.54-1_all.deb ...\n", + "Unpacking libcgi-pm-perl (4.54-1) ...\n", + "Selecting previously unselected package libfcgi0ldbl:amd64.\n", + "Preparing to unpack .../10-libfcgi0ldbl_2.4.2-2build2_amd64.deb ...\n", + "Unpacking libfcgi0ldbl:amd64 (2.4.2-2build2) ...\n", + "Selecting previously unselected package libfcgi-perl:amd64.\n", + "Preparing to unpack .../11-libfcgi-perl_0.82+ds-1build1_amd64.deb ...\n", + "Unpacking libfcgi-perl:amd64 (0.82+ds-1build1) ...\n", + "Selecting previously unselected package libcgi-fast-perl.\n", + "Preparing to unpack .../12-libcgi-fast-perl_1%3a2.15-1_all.deb ...\n", + "Unpacking libcgi-fast-perl (1:2.15-1) ...\n", + "Selecting previously unselected package libclone-perl.\n", + "Preparing to unpack .../13-libclone-perl_0.45-1build3_amd64.deb ...\n", + "Unpacking libclone-perl (0.45-1build3) ...\n", + "Selecting previously unselected package libencode-locale-perl.\n", + "Preparing to unpack .../14-libencode-locale-perl_1.05-1.1_all.deb ...\n", + "Unpacking libencode-locale-perl (1.05-1.1) ...\n", + "Selecting previously unselected package libfcgi-bin.\n", + "Preparing to unpack .../15-libfcgi-bin_2.4.2-2build2_amd64.deb ...\n", + "Unpacking libfcgi-bin (2.4.2-2build2) ...\n", + "Selecting previously unselected package libhtml-template-perl.\n", + "Preparing to unpack .../16-libhtml-template-perl_2.97-1.1_all.deb ...\n", + "Unpacking libhtml-template-perl (2.97-1.1) ...\n", + "Selecting previously unselected package libhttp-date-perl.\n", + "Preparing to unpack .../17-libhttp-date-perl_6.05-1_all.deb ...\n", + "Unpacking libhttp-date-perl (6.05-1) ...\n", + "Selecting previously unselected package libio-html-perl.\n", + "Preparing to unpack .../18-libio-html-perl_1.004-2_all.deb ...\n", + "Unpacking libio-html-perl (1.004-2) ...\n", + "Selecting previously unselected package liblwp-mediatypes-perl.\n", + "Preparing to unpack .../19-liblwp-mediatypes-perl_6.04-1_all.deb ...\n", + "Unpacking liblwp-mediatypes-perl (6.04-1) ...\n", + "Selecting previously unselected package libhttp-message-perl.\n", + "Preparing to unpack .../20-libhttp-message-perl_6.36-1_all.deb ...\n", + "Unpacking libhttp-message-perl (6.36-1) ...\n", + "Selecting previously unselected package mecab-utils.\n", + "Preparing to unpack .../21-mecab-utils_0.996-14build9_amd64.deb ...\n", + "Unpacking mecab-utils (0.996-14build9) ...\n", + "Selecting previously unselected package mecab-ipadic.\n", + "Preparing to unpack .../22-mecab-ipadic_2.7.0-20070801+main-3_all.deb ...\n", + "Unpacking mecab-ipadic (2.7.0-20070801+main-3) ...\n", + "Selecting previously unselected package mecab-ipadic-utf8.\n", + "Preparing to unpack .../23-mecab-ipadic-utf8_2.7.0-20070801+main-3_all.deb ...\n", + "Unpacking mecab-ipadic-utf8 (2.7.0-20070801+main-3) ...\n", + "Selecting previously unselected package mysql-server.\n", + "Preparing to unpack .../24-mysql-server_8.0.40-0ubuntu0.22.04.1_all.deb ...\n", + "Unpacking mysql-server (8.0.40-0ubuntu0.22.04.1) ...\n", + "Setting up libhttp-date-perl (6.05-1) ...\n", + "Setting up libmecab2:amd64 (0.996-14build9) ...\n", + "Setting up mysql-client-core-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Setting up libfcgi0ldbl:amd64 (2.4.2-2build2) ...\n", + "Setting up libclone-perl (0.45-1build3) ...\n", + "Setting up libhtml-tagset-perl (3.20-4) ...\n", + "Setting up liblwp-mediatypes-perl (6.04-1) ...\n", + "Setting up libfcgi-bin (2.4.2-2build2) ...\n", + "Setting up libencode-locale-perl (1.05-1.1) ...\n", + "Setting up libprotobuf-lite23:amd64 (3.12.4-1ubuntu7.22.04.1) ...\n", + "Setting up mecab-utils (0.996-14build9) ...\n", + "Setting up libio-html-perl (1.004-2) ...\n", + "Setting up mysql-server-core-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Setting up mysql-client-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "Setting up libfcgi-perl:amd64 (0.82+ds-1build1) ...\n", + "Setting up liburi-perl (5.10-1) ...\n", + "Setting up libhttp-message-perl (6.36-1) ...\n", + "Setting up mysql-server-8.0 (8.0.40-0ubuntu0.22.04.1) ...\n", + "invoke-rc.d: could not determine current runlevel\n", + "invoke-rc.d: policy-rc.d denied execution of stop.\n", + "update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode\n", + "Renaming removed key_buffer and myisam-recover options (if present)\n", + "mysqld will log errors to /var/log/mysql/error.log\n", + "mysqld is running as pid 1748\n", + "Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.\n", + "invoke-rc.d: could not determine current runlevel\n", + "invoke-rc.d: policy-rc.d denied execution of start.\n", + "Setting up mecab-ipadic (2.7.0-20070801+main-3) ...\n", + "Compiling IPA dictionary for Mecab. This takes long time...\n", + "reading /usr/share/mecab/dic/ipadic/unk.def ... 40\n", + "emitting double-array: 100% |###########################################| \n", + "/usr/share/mecab/dic/ipadic/model.def is not found. skipped.\n", + "reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146\n", + "reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210\n", + "reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328\n", + "reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171\n", + "reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999\n", + "reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151\n", + "reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42\n", + "reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032\n", + "reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135\n", + "reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19\n", + "reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795\n", + "reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199\n", + "reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91\n", + "reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42\n", + "reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750\n", + "reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252\n", + "reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120\n", + "reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208\n", + "reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146\n", + "reading /usr/share/mecab/dic/ipadic/Others.csv ... 2\n", + "reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393\n", + "reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221\n", + "reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668\n", + "reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477\n", + "reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202\n", + "reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328\n", + "emitting double-array: 100% |###########################################| \n", + "reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316\n", + "emitting matrix : 100% |###########################################| \n", + "\n", + "done!\n", + "update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode\n", + "Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-3) ...\n", + "Compiling IPA dictionary for Mecab. This takes long time...\n", + "reading /usr/share/mecab/dic/ipadic/unk.def ... 40\n", + "emitting double-array: 100% |###########################################| \n", + "/usr/share/mecab/dic/ipadic/model.def is not found. skipped.\n", + "reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146\n", + "reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210\n", + "reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328\n", + "reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171\n", + "reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999\n", + "reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151\n", + "reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42\n", + "reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032\n", + "reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135\n", + "reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19\n", + "reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795\n", + "reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199\n", + "reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91\n", + "reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42\n", + "reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750\n", + "reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252\n", + "reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120\n", + "reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208\n", + "reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146\n", + "reading /usr/share/mecab/dic/ipadic/Others.csv ... 2\n", + "reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393\n", + "reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221\n", + "reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668\n", + "reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477\n", + "reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202\n", + "reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328\n", + "emitting double-array: 100% |###########################################| \n", + "reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316\n", + "emitting matrix : 100% |###########################################| \n", + "\n", + "done!\n", + "update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode\n", + "Setting up libhtml-parser-perl:amd64 (3.76-1build2) ...\n", + "Setting up mysql-server (8.0.40-0ubuntu0.22.04.1) ...\n", + "Setting up libcgi-pm-perl (4.54-1) ...\n", + "Setting up libhtml-template-perl (2.97-1.1) ...\n", + "Setting up libcgi-fast-perl (1:2.15-1) ...\n", + "Processing triggers for man-db (2.10.2-1) ...\n", + "Processing triggers for libc-bin (2.35-0ubuntu3.4) ...\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n", + "\n" ] } ], "source": [ - "!brew install mysql" + "!apt-get -y install mysql-server" ] }, { "cell_type": "code", - "execution_count": 22, - "metadata": {}, + "execution_count": 13, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "DkHJ0EBXKNaW", + "outputId": "92e43fd6-d4e7-45bf-b0c4-50bdbd2e3e2d" + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "\u001b[34m==>\u001b[0m \u001b[1mSuccessfully started `mysql` (label: homebrew.mxcl.mysql)\u001b[0m\n" + " * Starting MySQL database server mysqld\n", + "su: warning: cannot change directory to /nonexistent: No such file or directory\n", + " ...done.\n" ] } ], "source": [ - "!brew services start mysql\n" + "!service mysql start\n" ] }, { "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ERROR 1524 (HY000) at line 1: Plugin 'mysql_native_password' is not loaded\n" - ] - } - ], + "execution_count": 14, + "metadata": { + "id": "7q8Fd2cAKNaX" + }, + "outputs": [], "source": [ "!mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'root';FLUSH PRIVILEGES;\"\n" ] }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "id": "ersqowNFKNaX" + }, "source": [ "### Connect to MySQL" ] }, { "cell_type": "code", - "execution_count": 23, - "metadata": {}, - "outputs": [ - { - "ename": "ProgrammingError", - "evalue": "1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mMySQLInterfaceError\u001b[0m Traceback (most recent call last)", - "File \u001b[0;32m~/miniconda3/envs/new_env/lib/python3.13/site-packages/mysql/connector/connection_cext.py:335\u001b[0m, in \u001b[0;36mCMySQLConnection._open_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 335\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cmysql\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcnx_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 336\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_cmysql\u001b[38;5;241m.\u001b[39mconverter_str_fallback \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_converter_str_fallback\n", - "\u001b[0;31mMySQLInterfaceError\u001b[0m: Access denied for user 'root'@'localhost' (using password: YES)", - "\nThe above exception was the direct cause of the following exception:\n", - "\u001b[0;31mProgrammingError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[23], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmysql\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mconnector\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m# Create a connection to the MySQL server\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[43mmysql\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43muser\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mroot\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassword\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mroot\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mhost\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mlocalhost\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Create a cursor to interact with the MySQL server\u001b[39;00m\n\u001b[1;32m 7\u001b[0m cursor \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39mcursor()\n", - "File \u001b[0;32m~/miniconda3/envs/new_env/lib/python3.13/site-packages/mysql/connector/pooling.py:322\u001b[0m, in \u001b[0;36mconnect\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 319\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mImportError\u001b[39;00m(ERROR_NO_CEXT)\n\u001b[1;32m 321\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m CMySQLConnection \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m use_pure:\n\u001b[0;32m--> 322\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mCMySQLConnection\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 323\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m MySQLConnection(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", - "File \u001b[0;32m~/miniconda3/envs/new_env/lib/python3.13/site-packages/mysql/connector/connection_cext.py:151\u001b[0m, in \u001b[0;36mCMySQLConnection.__init__\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 149\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m kwargs:\n\u001b[1;32m 150\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 151\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 152\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 153\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n", - "File \u001b[0;32m~/miniconda3/envs/new_env/lib/python3.13/site-packages/mysql/connector/abstracts.py:1426\u001b[0m, in \u001b[0;36mMySQLConnectionAbstract.connect\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 1423\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 1425\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdisconnect()\n\u001b[0;32m-> 1426\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_open_connection\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1428\u001b[0m charset, collation \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 1429\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcharset\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1430\u001b[0m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcollation\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1431\u001b[0m )\n\u001b[1;32m 1432\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m charset \u001b[38;5;129;01mor\u001b[39;00m collation:\n", - "File \u001b[0;32m~/miniconda3/envs/new_env/lib/python3.13/site-packages/mysql/connector/connection_cext.py:340\u001b[0m, in \u001b[0;36mCMySQLConnection._open_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 338\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconverter\u001b[38;5;241m.\u001b[39mstr_fallback \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_converter_str_fallback\n\u001b[1;32m 339\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m MySQLInterfaceError \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m--> 340\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m get_mysql_exception(\n\u001b[1;32m 341\u001b[0m msg\u001b[38;5;241m=\u001b[39merr\u001b[38;5;241m.\u001b[39mmsg, errno\u001b[38;5;241m=\u001b[39merr\u001b[38;5;241m.\u001b[39merrno, sqlstate\u001b[38;5;241m=\u001b[39merr\u001b[38;5;241m.\u001b[39msqlstate\n\u001b[1;32m 342\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[1;32m 344\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_do_handshake()\n\u001b[1;32m 346\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 347\u001b[0m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_ssl_disabled\n\u001b[1;32m 348\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_cmysql, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mget_ssl_cipher\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 353\u001b[0m \n\u001b[1;32m 354\u001b[0m \u001b[38;5;66;03m# `get_ssl_cipher()` returns the name of the cipher being used.\u001b[39;00m\n", - "\u001b[0;31mProgrammingError\u001b[0m: 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" - ] - } - ], + "execution_count": 15, + "metadata": { + "id": "pGJsLLFSKNaX" + }, + "outputs": [], "source": [ "import mysql.connector\n", "\n", @@ -654,15 +896,19 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "id": "E4lD995lKNaY" + }, "source": [ "### Create & Design a Database" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 16, + "metadata": { + "id": "Iyhy8RswKNaY" + }, "outputs": [], "source": [ "# Create a new database named 'articles_db'\n", @@ -688,15 +934,19 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "id": "F8QgpYWzKNaa" + }, "source": [ "### Populate the database" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, + "execution_count": 17, + "metadata": { + "id": "srC8jArIKNab" + }, "outputs": [], "source": [ "import mysql.connector\n", @@ -723,16 +973,37 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "id": "BVdHrkJVKNac" + }, "source": [ "### Query the database" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 18, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "vDGbRZGVKNae", + "outputId": "a0dd620d-f5ac-466a-885d-d26dd4638d33" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(1, 'Using Robots in Nursing Homes Linked to Higher Employee Retention, Better Patient Care', 'https://www.sciencedaily.com/releases/2025/01/250108173155.htm', 'Nursing homes are increasingly utilizing robots for various care tasks to address high employee turnover and an aging population, although research on the impact of these technologies is limited. A study indicates that the integration of robots in nursing homes is associated with improved employee retention rates and enhanced patient care quality.')\n", + "(2, 'Electrohydraulic Wearable Devices Create Unprecedented Haptic Sensations', 'https://www.sciencedaily.com/releases/2025/01/250108144220.htm', 'Scientists have developed compact wearable devices that provide rich and expressive tactile sensations, surpassing the basic vibrations of current consumer devices. New advancements in electrohydraulic wearable technology are reported to produce unique haptic sensations, enhancing user interaction with robotic systems.')\n", + "(3, 'Artificial Intelligence: Algorithms Improve Medical Image Analysis', 'https://www.sciencedaily.com/releases/2025/01/250102162630.htm', 'AI has the potential to enhance the analysis of medical images, with deep learning algorithms capable of identifying tumor locations and sizes.')\n", + "(4, 'DNA Nanorobots Can Alter Artificial Cells', 'https://www.sciencedaily.com/releases/2025/01/250113134758.htm', 'Research reveals that DNA nanorobots have the capability to modify artificial cells, showcasing potential applications in biotechnology and medicine.')\n", + "(5, 'A Smart Ring With a Tiny Camera Lets Users Point and Click to Control Home Devices', 'https://www.sciencedaily.com/releases/2025/01/250109130038.htm', 'This innovative smart ring features a miniature camera that allows users to control various home devices through simple point-and-click actions.')\n", + "(6, 'Advancements in Neural Implant Research Enhance Durability', 'https://www.sciencedaily.com/releases/2025/01/250107140908.htm', 'Recent research in neural implants has led to improvements in their durability, which could significantly impact the field of robotics and human-machine interfaces.')\n" + ] + } + ], "source": [ "import mysql.connector\n", "\n", @@ -775,7 +1046,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1362,7 +1633,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/"