Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Duplicate a database

Tags:

mysql

I want to copy (all data, schema, procedures and so on) from database1 to database2, that are located on the same server. I've tried using mysqldump but each time I get

ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

That because my root user that I use for this operation does not have SUPER privilege and I don't have access to change this.

Is there a solution to do this without using mysqldump?

Keep in mind that it's a pretty big database with over one hundred tables.

like image 556
Alex Chihaia Avatar asked May 18 '26 20:05

Alex Chihaia


1 Answers

You have to grant privilegies to the user:

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'yourhost';

if you want to do it for all databases:

GRANT SELECT ON *.* TO 'username'@'yourhost';
FLUSH PRIVILEGES;
like image 193
A Monad is a Monoid Avatar answered May 20 '26 10:05

A Monad is a Monoid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!