This documents contains my daily search on StackOverflow as a software engineer. I don't know how many repititve things and commands I search everyday. That's the reason i want to reduce my stackoverflow search while coding.
Check whether mysql is installed and running on your system.
which mysql
sudo service mysql status
First Create a new database in mysql before importing.
- Login to MYSQL on your local system.
mysql -u USER_NAME -p
- Create new Database.(In MYSQL shell)
CREATE database DB_NAME
- Now, Import Your mysql dump.
mysql -u MYSQL_USERNANME -p DB_NAME < DB_PATH
mysqldump -h HOST_NAME -u USER_NAME -p DB_NAME > DUMP_NAME.sql
If you get this mysqldump: Got error: 1044 Access deined when using lock tables.
Run this command by adding --single-transaction
mysqldump --single-transaction -h HOST_NAME -u USER_NAME -p DB_NAME > DUMP_NAME.sql