What happens to sql views, if database is moved to another server

98 Views Asked by At

I have created a view in my current database. But now I'm moving the database to another server. Normally I'm taking the dump, but not sure about views.

Will they come when I import the dump and work as per the view? Or I need to create view again?

1

There are 1 best solutions below

3
On BEST ANSWER

The dump you create with mysqldump will contain the CREATE VIEW statements.

The MySQL documentation says:

mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, and LOCK TABLES if the --single-transaction option is not used. Certain options might require other privileges as noted in the option descriptions.