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