Reputation: 153
phpMyAdmin shows an error during importing the exported .sql file. It gives message like this SQL query:
--
mcadatabase
--
trick
CREATE TABLE IF NOT EXISTS trick
(
id
int(5) unsigned NOT NULL,
question
varchar(20000) NOT NULL,
option1
varchar(200) NOT NULL,
option2
varchar(200) NOT NULL,
option3
varchar(200) NOT NULL,
option4Right
varchar(200) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
MySQL said: Documentation
Upvotes: 2
Views: 11647
Reputation: 11017
Export
mysqldump -u username –-password=your_password database_name > file.sql
Import
mysql -u username –-password=your_password database_name < file.sql
Upvotes: 0
Reputation: 140
Use command Line to import/export database
Import:
Export:
Upvotes: 2
Reputation: 549
For Exporting open a terminal :-
mysql -u root -p your_database_name > any_file_name.sql
For Importing:-
mysql -u root -p < sql_file_name.sql
For exporting only a table in your database:-
mysql -u root -p your_database_name your_table_name > any_file_name.sql
Importing a table remains same as above.
Hope this helps!
Upvotes: 1
Reputation: 665
With phpMyAdmin, you need to create a database named mcadatabase
. Then, select this database and select Import
.
Upvotes: 3
Reputation: 2409
I'd suggest looking at mysqldump (http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html)
Upvotes: 0