creating DB

Boballoo

Verified User
Joined
Aug 31, 2005
Messages
62
I have a database that I would like to upload to the server. I could not find how to do this through phpMyAdmin since it asks you to first select a DB. Obviously I cannot do that since I have not uploaded it yet.

Then I created the DB in the control panel under the site I wanted it in (All my sites are created under the admin since they are all my sites and I am the admin.) However, when I then go to phpMyAdmin there is only one DB there and it is for another of my sites.

The new DB shows up in the DirectAdmin DB list but not in the phpMyAdmin list of DBs.

I tried uploading my DB from DirectAdmin and was successful but it still says "0.0 MB" and does not show in phpMyAdmin.

How can I get the DB structure I have in "****.sql" format onto my server so I can view it in phpMyAdmin and add or change tables through phpMyAdmin?

Your help is appreciated.
 
Try deleting the database through DirectAdmin and then recreating it. Then login to the database through phpmyadmin using the username and password you used when you first created the database. If that works, then you can go to the sql section of phpmyadmin and upload your.sql file (if it's under the max upload filesize limit set in php.ini (2mb default)).

Contact your hosting provider if you do not have admin/root access to the server.
 
jmstacey said:
Try deleting the database through DirectAdmin and then recreating it. Then login to the database through phpmyadmin using the username and password you used when you first created the database. If that works, then you can go to the sql section of phpmyadmin and upload your.sql file
That worked to a point but now I get an error when I try to upload the file from the SQL section of phpmyadmin "#1007 - Can't create database 'DB_NAME'. Database exists. I then tried creating the new database using phpmyadmin from another DB that exists (I know this is wrong but I have tried everything else) and got an error "#1044 - Access denied for user: 'DB1_USER' to database 'DB2_NAME' I have struggled with this for days and cannot get it to work. The DB is empty (just the table structure) so it is no where near the limit of 2mb and I have changed that limit anyway to allow the uploading of the other DB.
 
I assume you have root access.
Login to MySQL via phpmyadmin or command line as root or da_admin, delete the database. Make sure it is deleted through DirectAdmin's MySQL area aswell and then try recreating it.
 
Thanks for your help. Maybe we can solve this or solve my misunderstanding
jmstacey said:
I assume you have root access.
Yes. This is my dedicated server.
Login to MySQL via phpmyadmin or command line as root or da_admin, delete the database.
I did this previously before trying to create the new DB. #2 DB is not there. #1 DB is still there just as it should be.
Make sure it is deleted through DirectAdmin's MySQL area as well and then try recreating it.
I did this. When I recreate it, it shows up in phpmyadmin but there are no tables and no contents etc. When I try to upload the .sql file I get the error that the DB already exists. That's because it does exist. If it did not exist I could not get into the sql section of phpmyadmin.
 
I would probably modify the .sql file you're trying to upload and remove the line at the top somewhere that says "CREATE DATABASE DB#2" or whatever.
 
ballyn said:
I would probably modify the .sql file you're trying to upload and remove the line at the top somewhere that says "CREATE DATABASE DB#2" or whatever.
THANK YOU!! That worked perfectly. But is that line needed later for anything? I suspect not but I wonder why this solution has not been mentioned previously? Is this standard procedure? Anyway you have solved a three week problem and I thank you very much!
 
That line creates the database and is useful if your running the .sql file as a superuser who has the power to create databases through MySQL directly.

Is this standard procedure?
It depends how you made the backup. Through phpmyadmin you have many options including such things as whether the db should be created, or if all existing tables should be dropped before inserting the new data.
 
Back
Top