MySQL Forums
Forum List  »  MySQL Shell

sqldump with database schema
Posted by: Alain Roger
Date: November 16, 2020 10:03AM

Hi,

i would like to build a script that make a backup of my database and user under linux.

for that i know how to do a sqldump of the database, however it does not dump the database name itself... so it does not generate a create database xyz... it's only export tables and data from the database itself.

Moreover how to do an export in command line of the users attached to the specific database ?

to export database, i do a sqldump like (it's on local ubuntu desktop) :
mysqldump -h 127.0.0.1 -u root --no-data --column-statistics=0 wpgdpr > wpgdpr_schema.sql

however, it exports only tables and data... nothing about the schema name and the user attached to this database.

Thx

Options: ReplyQuote


Subject
Views
Written By
Posted
sqldump with database schema
197
November 16, 2020 10:03AM
87
November 16, 2020 12:18PM
86
November 16, 2020 02:46PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.