DB import - new Database is created

Started by towertech, Sep 30, 2022, 01:03 AM

Previous topic - Next topic

towertechTopic starter

To solve this problem, I typically create a basename database and import another database using the following command: "mysql -u root -password phpmyadmin basaname < /var/www/baseimport.sql". However, when dealing with larger databases, a new database is automatically created with the name I specified during creation. For example, if I named the database "abcdesfg" and imported it as "baseimport.sql" on another server, a new database with the name "abcdesfg" would be created in the admin panel. Unfortunately, I am unable to log in to phpmyadmin and view this database, even with the correct password. Instead, I can view the basename database that I imported the dump into, which unfortunately returns empty results.

To ensure that the database is not creating itself or to gain access to it, I am unsure of where to obtain the necessary credentials to connect to the website. Perhaps further research or contacting the appropriate parties may provide a resolution.
  •  

dasiydan88

To gain access and control to a newly created database, it is necessary to remove the CREATE DATABASE command from the corresponding sql file which should have already been executed during the database creation process. Additionally, the switch command (USE database name) should be set to the newly created database.

When logged in as root, full access and control over all databases, including phpmyadmin, is granted. It is even possible to change the user and password of the selected database via phpmyadmin. With root access, practically unlimited control is allowed. These instructions assume that access to the newly created database is already granted.
  •