- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I move an existing MySQL event to another database?
It can be done with the help of ALTER EVENT statement too. We need to use the combination of database name and event name along with the RENAME keyword. To illustrate it we are having the following example in which we are moving the event named ‘hello_renamed’ from ‘query’ database to ‘tutorial’ database −
Example
mysql> ALTER EVENT query.hello_renamed RENAME to tutorials.hello_renamed; Query OK, 0 rows affected (0.00 sec)
To confirm that event has been moved to database ‘tutorials’ we can try to delete the event with an old name, MySQL will throw an error as follows −
mysql> DROP event hello_renamed; ERROR 1539 (HY000): Unknown event 'hello_renamed'
- Related Articles
- How can we modify an existing MySQL event?
- How can we RENAME an existing MySQL event?
- How can we delete an existing MySQL event permanently?
- How can I modify an existing MySQL column’s data type?
- How can I drop an existing column from a MySQL table?
- How can we create a table from an existing MySQL table in the database?
- How can we drop an existing database by using mysqladmin?
- How can I replace & with an ampersand in my MySQL database?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How to increase varchar size of an existing column in a database without breaking existing data in MySQL?
- How can I change the name of an existing column from a MySQL table?
- How can we create a MySQL view based on another existing view?
- While connecting to one MySQL database, how can I see the list of tables of other MySQL database?
- How can I modify an existing column's data type?
- How can I set a MySQL database to use MyISAM by default?

Advertisements