Solution to PhpMyAdmin SQL File Import failure

Source: Internet
Author: User
Tags mysql tutorial cpanel

Php Tutorial: How to import SQL files in myadmin

The following error message is displayed when I directly import data using phpmyadmin:

Warning: cannot modify header information-headers already sent by (output started at/usr/local/cpanel/base/3 rdparty/phpmyadmin/export. php: 190) in/usr/local/cpanel/base/3 rdparty/phpmyadmin/libraries/ob. lib. php on line 83

 

In the command window:

Mysql tutorial> source d:/datafilename. SQL


First, open mysql in the command line Console

Perhaps the command is as follows:

Mysql-u root-p database_name
Then you may be prompted to enter the corresponding Password

2. The following command may be useful to you. When you want to replace a database tutorial

Mysql> use database_name


Run the following command:

Mysql> source d: datafilename. SQL

Of course, you need to clarify the path of the file and use it correctly.

Put the SQL file in the directory where mysql.exe is located. You only need a file name to save a lot of trouble.

See the import instance below

C:> mysqldump-uroot-p -- add-drop-table -- tables test testtable> c: testtable. SQL
Enter password :******

C:> mysql-uroot-p
Enter password :******
Welcome to the mysql monitor. commands end with; or g.
Your mysql connection id is 1311
Server version: 5.0.45-community-nt mysql community edition (gpl)

Type 'help; 'or 'H' for help. type 'C' to clear the buffer.

Mysql> use test
Database changed
Mysql> truncate table testtable;
Query OK, 4 rows affected (0.02 sec)

Mysql> select * from testtable;
Empty set (0.00 sec)

Mysql> source c: testtable. SQL

Note:

The phpmyadmin file has a limited import size, which seems to be 2 MB. Therefore, the command is recommended for import.
The usage is as follows:
1) Go to the mysql Database Console,
For example, mysql-u root-p
2) mysql> use Database
3) run the source command. The following parameter is the script file (for example,. SQL used here)
Mysql> source d: wcnc_db. SQL

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.