This topic describes how to import a local sql file into a Web Hosting database using the MySQL Command Line Client.
Prerequisites
MySQL is installed on your local machine. You can download MySQL from the official MySQL website.
Procedure
- Obtain database information.
- Log on to the Web Hosting console.
- Find your target Web Hosting instance and click Manage in the Actions column.
- In the left-side navigation pane, click Database Information.
- On the Database Information page, note the database endpoint, database account, and database name.Note If you forget the database password, you can reset it. For more information, see Reset the database password for Web Hosting.

-
Open a Command Prompt window.
-
Run the following command to import the local sql file into the Web Hosting database.
-
Run the preceding command.
-
Enter the password when prompted.
-
Add the path to the
MySQL\bindirectory to yourPathenvironment variable. You may need to restart your computer for the change to take effect. Then, you can run themysqlcommand from any directory. -
Use the
cdcommand to navigate to theMySQL\bindirectory. Then, run themysqlcommand from this directory.
mysql -h <database endpoint> -u <database account> -p --default-character-set=utf8 <database name> < path/to/your/local/file.sql
For example, to import the backup file bdmxxxxxx_db.sql from the D: drive to a Web Hosting database:
If you see the error message 'mysql' is not recognized as an internal or external command, operable program or batch file.', it means the path to the MySQL\bin directory is likely missing from your Path environment variable.
You can resolve this issue in one of the following ways:
Results
Running the command imports the data from the local sql file into the Web Hosting database.