mysqldump -u username -p database_name > data-dump.sql
mysqldump -u<user_name> -p<user_password> <database_name> > <file_name>.sql
#note by specifying -p flag without a password it'll prompt you for pass
DUMP:
mysqldump -u username -p dbname --lock-tables=false > filename.sql
Import:
mysql -u username -p dbname < filename.sql
Import external:
mysql -h host -u username -p dbname < filename.sql
mysqldump -u username -p dbname > filename.sql
mysql -u username -p dbname < filename.sql
mysql -u username -p database_name < file.sql
mysqldump -h <hostname> -u <username> -p <database_name> > file-dump.sql
mysql -u<user_name> -puser_password> <database_name>
source /path/db.sql
mysql> use db_name;
mysql> source backup-file.sql;
Code Example |
---|
Sql :: SQL Auto Increment Primary Key - PostgreSQL |
Sql :: postgres show databases |
Sql :: mysql store ip address |
Sql :: create temporal table in sql |
Sql :: sql foreign key |
Sql :: wildcard in sql |
Sql :: postgresql check privileges on schema |
Sql :: referential integrity constraint |
Sql :: mariadb mysql root access denied |
Sql :: oracle revoke grant |
Sql :: sql any |
Sql :: SQL Server lock table example |
Sql :: 1396(hy00) mysql error |
Sql :: postgres set null |
Sql :: rename a table in sql server |
Sql :: Get first 10 in sql |
Sql :: create or replace function |
Sql :: sql date format dd-mm-yyyy |
Sql :: update join sql |
Sql :: drop sequence |
Sql :: mysql if condition |
Sql :: sql extract from mail |
Sql :: drop a view in sqlite |
Sql :: raiserror nowait sql server |
Sql :: add time to date sql |
Sql :: mysql count by month |
Sql :: oracle array |
Sql :: get the location of where postgres database is stored |
Sql :: Save PL/pgSQL output from PostgreSQL to a CSV file |
Sql :: sql rtrim |