Can I change the name of a MySQL database?

The name of a MySQL database consists of a prefix, which is your cPanel username, followed by a "_" sign and the actual database name.

 

For example, if your cPanel username is user and you create a database  db, the database name will be user_db.

 

Thus, if you wish to change the whole name of a database, two changes should be made - the cPanel username and the database name.

 

In order for a cPanel username to be changed, we have to terminate the account and re-create it anew with the new username. This means you will lose all the data stored on the hosting account, like files, email addresses, MySQL databases, forwarders, etc.

 

This is why it is not recommended to change your username. However, you can easily change the database name suffix by simply creating a new database with the new name and importing the old database in it.

 

In other words, if you wish to rename the database user_db to user_whn, you should first create the new database, then import the old database in it and finally add the user to the new database.

  • 1 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

How can I change my MySQL database collation?

Usually you will be interested in changing your MySQL collation in order to solve problems with...

How can I empty a MySQL database?

The easiest way to empty a MySQL database is through phpMyAdmin.  Once in phpMyAdmin, select the...

How to change the database engine of a MySQL database table?

In this article we will show you how to change the database engine of a MySQL table. Let's...

How to change the MySQL timezone

When you develop your website, you may have to compare a certain date/time with the current...

How to change the password of a Mysql user in cPanel?

If you have already created a MySQL user through the cPanel -> Mysql Databases tool you may...