How to import and export a mysql database as root

MySQL Backup

mysqldump -u root -p DBNAME > BKPNAME.sql

———–

MySQL Restore

mysql -u root -p DBNAME < BKPNAME.sql

You pay leave out the “-p” and it won’t ask you for the root password –

-p, –password[=name]
Password to use when connecting to server. If password is
not given it’s asked from the tty.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *