Alex Chihaia
Alex Chihaia

Reputation: 155

MySQL Duplicate a database

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.

Upvotes: 3

Views: 242

Answers (1)

developer_hatch
developer_hatch

Reputation: 16222

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;

Upvotes: 2

Related Questions