Home > Database > Mysql Tutorial > body text

How to Import Large SQL Files into phpMyAdmin When Facing Upload Size Restrictions?

Patricia Arquette
Release: 2024-10-27 05:24:29
Original
975 people have browsed it

How to Import Large SQL Files into phpMyAdmin When Facing Upload Size Restrictions?

Importing Large SQL Files into phpMyAdmin

Importing large SQL files into phpMyAdmin can encounter limitations due to the application's upload size restrictions. To overcome this issue and import files that exceed the supported size, consider executing the import from the MySQL console using the command line.

Solution:

  1. Connect to the MySQL console:

    • Open a terminal or command prompt.
    • Navigate to the directory where your MySQL binary is located (typically in /usr/local/mysql/bin).
    • Establish a connection to the MySQL console using the following command:
    mysql -u [DB-USER-NAME] -p [DB-NAME]
    Copy after login

    Replace [DB-USER-NAME] with your database username and [DB-NAME] with the name of the database you want to import the data into.

    You will be prompted to enter your password.

  2. Import the SQL file:

    • Navigate to the location of the SQL file you want to import.
    • Use the < operator to redirect the contents of the file to the MySQL console, specifying the path to the file:
    < [db.file.sql path]
    Copy after login

    Replace [db.file.sql path] with the full path to your SQL file.

  3. (Optional) Specify the host:

    • If your MySQL database is located on a remote server, use the -h flag to specify the hostname:
    mysql -u [DB-USER-NAME] -h [MySQL-SERVER-HOST-NAME] -p [DB-NAME] < [db.file.sql path]
    Copy after login

    Replace [MySQL-SERVER-HOST-NAME] with the hostname of your remote server.

The above is the detailed content of How to Import Large SQL Files into phpMyAdmin When Facing Upload Size Restrictions?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!