Home
About
Resume
Projects
Links
Blog
Download notebook
{ "cells": [ { "cell_type": "markdown", "id": "5c02fefb-09ac-4837-8883-e9b27d3c2f17", "metadata": {}, "source": [ "### MySQL Import Database from SQL File" ] }, { "cell_type": "markdown", "id": "d46049be-7597-4335-942e-b49f8fb0b1b8", "metadata": {}, "source": [ "##### Pre-requisite\n", "1. Have the root access to the MySQL Server." ] }, { "cell_type": "markdown", "id": "fc0968e3-eb8e-46eb-b2e8-b3caa85d0861", "metadata": {}, "source": [ "###### 1. Import database using `source`\n" ] }, { "cell_type": "markdown", "id": "b8c631bc-34c1-486b-bdb6-0f551ebce33c", "metadata": {}, "source": [ "Login `root` account in a `bash` shell \n", "*You are suggested to login the root account in the terminal rather than using Jupyter Notebook*" ] }, { "cell_type": "raw", "id": "f8d64438-80d4-4cd9-b3d0-e42b5b4dfa70", "metadata": {}, "source": [ "sudo mysql" ] }, { "cell_type": "raw", "id": "c106898c-f885-4a61-811e-78c855993a5f", "metadata": {}, "source": [ "source mysql_example_database.sql" ] }, { "cell_type": "markdown", "id": "707ff2a6-ac3f-4eb1-b74e-9e969aa0583a", "metadata": {}, "source": [ "###### 2. Import database using `<`" ] }, { "cell_type": "raw", "id": "1f82c823-13ae-49dd-abaa-5ea3f4cdd26a", "metadata": {}, "source": [ "sudo mysql -u root -p classicmodels < mysql_example_database.sql;" ] } ], "metadata": { "kernelspec": { "display_name": "Mysql", "language": "sql", "name": "mysql" }, "language_info": { "file_extension": ".sql", "mimetype": "text/x-sh", "name": "sql" } }, "nbformat": 4, "nbformat_minor": 5 }
Previous Notebook:
MySQL Browsing
Next Notebook:
MySQL Select
Loading