PDA

View Full Version : I need help moving a database



Dark Vaati
05-15-2008, 05:49 AM
Hello, first of all, sorry about my possible mistakes while writting. I'm spanish.

I've got a Hostmonster host account since November, and then I did not move my database to Hostmonster because I found many problems while moving it. I kept my old database and I linked my site to it.

Now my old hosting account is going to expire, and even my site stopped detecting my database two months ago. I didn't care cause I needed some time for my studies, but now I want to reopen my site, so I want to save all my old data.

The basic problem is that I have not been able to move my database backup to Hostmonster. I have made a backup in a SQL file, and I have edited it with MFC WordPad, changing those parameters:


BEFORE

-- Servidor: mysql3.freehostia.com
-- Tiempo de generación: 14-05-2008 a las 20:15:47
-- Versión del servidor: 4.1.11
-- Versión de PHP: 5.2.0-8+etch9~bpo31+1
--
-- Base de datos: `andpre84_blog`
--
CREATE DATABASE `andpre84_blog` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE andpre84_blog;

[...]

INSERT INTO `phpbb_config` VALUES ('EM_ftp_user', 'andpre84');

--------------------------------------------------------------------------

AFTER

-- Servidor: localhost
-- Tiempo de generación: 14-05-2008 a las 20:15:47
-- Versión del servidor: 4.1.11
-- Versión de PHP: 5.2.0-8+etch9~bpo31+1
--
-- Base de datos: `darkvaat_diario`
--
CREATE DATABASE `darkvaat_diario` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE darkvaat_blogger;

[...]

INSERT INTO `phpbb_config` VALUES ('EM_ftp_user', 'darkvaat');



I think this is OK, but if anybody can confirm it, I would be very pleased.

Then I've gone to my Hostmonster control panel, and I've created a database named "darkvaat_diario" and a user named "darkvaat_blogger". Then to PhpMyAdmin and I've selected "Import". I've uploaded the edited SQL file and I've waited for a while. When finished, a message said that the database could not be created cause already existed.

Then I've returned to my control panel, I've erased the database but not the user, and I've tried again to import the SQL file. After waiting, a message said something like:

#1044 - Access denied for user 'darkvaat'@'localhost' to database 'darkvaat_diario'

I'm not any kind of expert in those matters, so I don't know what more can I do. Someone can help me?

Thanks a lot :o

linFox
05-15-2008, 06:33 AM
You can only create databases from cPanel, any attempt to do so from other angles will result in failure (access denied, as you see there).

Recreate the database in cPanel, then remove the CREATE DATABASE ... line from your SQL file and import it again.