Preamble
The RENAME USER statement is used to rename a user in a MySQL database.
Syntax of RENAME USER statement in MySQL
RENAME USER
user_name TO new_name;
Parameters and arguments of the operator
- user_name – the user name to be renamed in a MySQL database.
- new_name – the new name to be assigned to the user.
Let us consider an example of how to use the RENAME USER operator to rename a user into MySQL.
For example:
RENAME USER
'samvyl'@'localhost' TO 'sergio'@'localhost';
In this example, the RENAME USER operator renamed the user samvyl to sergio in a MySQL database.
Rename more than one user
You can rename more than one user at a time into MySQL. You can use the RENAME USER operator to rename several users by separating them with a comma.
For example:
RENAME USER
'samvyl'@'localhost' TO 'garigan'@'localhost',
'sergio'@'localhost' TO 'drango'@'localhost';
This RENAME USER example has renamed two users into MySQL. The first user, named samvyl, was renamed garigan and the second user, named sergio, was renamed drango.
How to Rename User in MySQL Server
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Enhancing Identity and Access Management in Healthcare with Enteros
- 19 November 2024
- Database Performance Management
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
Maximizing Efficiency with Enteros: Revolutionizing Cost Allocation Through a Cloud Center of Excellence
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
Driving Efficiency in the Transportation Sector: Enteros’ Cloud FinOps and Database Optimization Solutions
- 18 November 2024
- Database Performance Management
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…
Empowering Nonprofits with Enteros: Optimizing Cloud Resources Through AIOps Platform
In the fast-evolving world of finance, where banking and insurance sectors rely on massive data streams for real-time decisions, efficient anomaly man…