restore bak file sql server script code example

Example 1: xampp import sql file command line

C:\xampp\mysql\bin>mysql -u {DB_USER} -p {DB_NAME} < path/to/file/ab.sql

Example 2: import mysql dump database command line linux

mysql -u<user_name> -puser_password> <database_name>
source /path/db.sql

Example 3: mysql backup dump docker file

docker run -it --rm --link my-old-database:mysql mysql sh -c 'echo "[client]\n host=\"$MYSQL_PORT_3306_TCP_ADDR\"\n user=root\n password=\"$MYSQL_ENV_MYSQL_ROOT_PASSWORD\"" > my.cnf && exec mysqldump --defaults-file=my.cnf --databases my_database_name' > db_dump.sql