Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysqldump

# Syntax
mysqldump -u [username] -p [database-to-dump] > [database-to-receive]

# Pipe it! Exporting DB from external host
mysqldump -u [username] -P [port] -h [host] [database-to-dump] | mysql -u root -h 127.0.0.1 [database-to-receive]

# Export specific tables by typing the name after the targeted DB
mysqldump -u [username] -P [port] -h [host] [database-to-dump] [tabl1] [table2] [table3] | mysql -u root -h 127.0.0.1 [database-to-receive]
Comment

mysqldump with WHERE clause

$> mysqldump -umy_user_name -p database_name  --tables my_table1 --where="date_created > '2016-01-01' " > mytable1_filtered_dump.sql
Comment

mysqldump database

#To export single database
mysqldump -h [server] -u [user] -p [database_name]  | gzip > [filename].gz
Comment

install mysqldump

# Mysql
sudo apt-get install mysql-client
# MariaDB
sudo apt-get install mariadb-clients
Comment

mysqldump cli

/etc/init.d/nginx start
Comment

mysqldump

mysqldump -u [username] -p [database-to-dump] > filename(e.g. dump.sql)

# or 
sudo mysql database_name > filename
Comment

mysqldump

mysqldump -u [username] -p [database-to-dump] > [database-to-receive].sql
Comment

mysqldump cli command

Press CTRL+C to copy shell> mysqldump --databases db1 db2 db3 > dump.sql
Comment

mysqldump php

$ composer require ifsnop/mysqldump-php

Comment

mysqldump filter

mysqldump -uUSER -pPASS --ignore-table={database1.test1,database1.test3} database1 > database1.sql
Comment

PREVIOUS NEXT
Code Example
Sql :: like postgres 
Sql :: mysql split explode 
Sql :: oracle select into and inner join 
Sql :: how do you insert boolean to postgresql 
Sql :: enable mysql query log 
Sql :: sql query interview questions 
Sql :: primary key auto increment in postgresql 
Sql :: sql Not like operator 
Sql :: round decimal mysql 
Sql :: Oracle Procedure ex2 
Sql :: SQL AS With More Than One Column 
Sql :: use table postgres 
Sql :: cronjob mysql backup 
Sql :: sql commands in android 
Sql :: how to list all values of a column that start with a letter in sql 
Sql :: trncate table with relationships 
Sql :: oracle 11g default profile values 
Sql :: postgres multiple left join causing duplicates jsonb_agg 
Sql :: list enums sql 
Sql :: value of sold product using having and group by in sql 
Sql :: mysql aspas simples 
Sql :: connect colab with Microsoft sql server 
Sql :: sqlite schema structure of a relational database 
Sql :: how to remove quotes from a string in ssis load file 
Sql :: split a database into related tables based on their structure in MySQL 
Sql :: sql developer export connections 
Sql :: how to add column in oracle 
Sql :: sql null functions 
Sql :: numeric in sql 
Sql :: liquibase create table example 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =