

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- 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 drop an existing column from a MySQL table?
- How can I modify an existing MySQL column’s data type?
- How can we drop an existing database by using mysqladmin?
- How can we create a table from an existing MySQL table in the database?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How can I replace & with an ampersand in my MySQL database?
- 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?
- How can I trigger an onchange event manually in javascript?
- How can I modify an existing column's data type?
- How to increase varchar size of an existing column in a database without breaking existing data in MySQL?
- Move rows from one table to another in MySQL?
Advertisements