DbSchema Database Designer

DbSchema | MySQL - How to rename a Database



In this article, I’m going to show you how to create a mysql dump and use it to rename your mysql database.

First of all, open the start bar, write cmd and run it as administrator by right-clicking on it. After that, navigate to the MySQL Server bin folder.
Once there, create a mysql dump:

  mysqldump -u username -p -R database_name > dbname.sql;
  • Replace the username, password and dbname;
  • Replace the name of the dump file (.sql).

Now, create a new database with the new name:

 mysqladmin -u username -p create new_dbname;

Make sure that this name is not already in use. Enter the mysql shell with __mysql.exe -u root -p and execute __SHOW DATABASES. To check if the database is created, use this command. To exit the shell, type __exit`.

Then, you have to import the dump in the newly created database:

mysql –u username –p new_dbname < dbname.sql;

The last step is to delete the old database:

 mysqladmin -u username –p drop dbname;

After creating the new database, you may have to grant the privileges back to some users. Read this article to see how.

DbSchema → Your Trusted Partner in Database Design

Simplify complex database workflows and improve productivity with DbSchema's advanced design and management tools

Visual Design & Modeling
Visual Design & Schema Layout

➤ Create and manage your database schema visually through a user-friendly graphical interface.

➤ Easily arrange tables, columns, and foreign keys to simplify complex database structures, ensuring clarity and accessibility.

GIT & Collaboration
Version Control & Collaboration

➤ Manage schema changes through version control with built-in Git integration, ensuring every update is tracked and backed up.

➤ Collaborate efficiently with your team to maintain data integrity and streamline your workflow for accurate, consistent results.

Data Explorer & Query Builder
Relational Data & Query Builder

➤ Seamlessly navigate and visually explore your database, inspecting tables and their relationships.

➤ Build complex SQL queries using an intuitive drag-and-drop interface, providing instant results for quick, actionable insights.

Interactive Documentation & Reporting
HTML5 Documentation & Reporting

➤ Generate HTML5 documentation that provides an interactive view of your database schema.

➤ Include comments for columns, use tags for better organization, and create visually reports.