Heya guys. I'm developing locally and when I'm about to upload my database to my web host I got some error. The first time I tried uploading it (using PHPMyAdmin), it returned me '#1007 - Can't create database 'databasename'; database exists' error. So I deleted the existing database on my web host and tried uploading again and this time it returned me another error - '#1044 - Access denied for user 'sitename'@'localhost' to database 'databasename'.
One more thing. When I exported the same database the other time from my web host to my local machine it all went perfectly smooth without a hitch. Was using the same method. I don't know why I keep getting this error now trying to upload the same database to my web host.
I don't know how to deal with this. Please help.
Comments
Which web host??
Database creation and administration is different on each web host. Dreamhost for instance does not let you run a script to create a database from phpmyadmin. You have to use their control panel.
Hiveminds Magazine | Drupal Developers Network | 5.0 Developers Guide in offline CHM format
You may have to delete and
You may have to delete and modify the first few lines of your SQL dump. Paste the first few lines here (maybe around 50) and I could advice you what to delete and modify.
Ok here it goes.... --
Ok here it goes....
Create the database bwdb
Create the database bwdb manually.
Then, delete this line from your dump before uploading it to the database server:
CREATE DATABASE `bwdb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;it worked
this worked for me i used note pad to remove CREATE DATABASE `name` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
it all works again
thanks
OK folks what I really want
OK folks what I really want here is to find a way to easily upload my database to and from my local machine anytime I want to. I'm open to whatever ways possible in doing this so please lay out all the options you can think of.
Much appreciated.
Hello? Anyone?
Here's what my host told me.
In order to import a database that already exists, you need to either rename the database in the .sql file using a unix standard text editor like "vi"Well I went looking for the VI text editor and it seems to be only for Unix. I'm in Windows. And even if I had that text editor I don't know where/what to edit exactly. Besides, why do I need to download another text editor, isn't Notepad enough already to do such editing?
Can you create a database using phpMyadmin?
Create a database on the host side and then export only the tables and data locally. Then import the tables and data on the host server.
Hiveminds Magazine | Drupal Developers Network | 5.0 Developers Guide in offline CHM format
I have already asked my host
I have already asked my host to allow me to create db using phpmyadmin. I don't know yet if they would give me access or even if they will I don't know if this will fix my prob.
I don't know... import/export by tables seem a very tedious process as I have a big database.
If you have a large database
If you have a large database then you are going have to use something like Big Dump anyway. phpMyAdmin has a upload limit of 2mb or so depending on the server.
The only other way is to upload the *.sql script to the server and run in via the shell, if you have shell access.
Hiveminds Magazine | Drupal Developers Network | 5.0 Developers Guide in offline CHM format
As you already mentioned that
As you already mentioned that you used PHPMyAdmin on your host machine. So follow the steps.
Enjoy!