mysql - How to import all databases sql file into phpmyadmin -
i have exported databases (localhost.sql) phpmyadmin. trying import database file (localhost.sql) using command mysql -u root -p < /localhost.sql
this showing error no database selected.
localhost.sql has database, dont have other backup of databases except localhost.sql file.
because when export file phpmyadmin there no database name. if want it, when export click "custom" in section export method , tick "add create database / use". or add @ top of localhost.sql :
create database if not exists `nameofyourdatabase` default character set latin1 collate latin1_swedish_ci; use `nameofyourdatabase`;
or method use : export, drop/delete , recreate db same name import localhost.sql
Comments
Post a Comment