Forums

Importing Dump file, Access Denied

I don't know what I'm doing wrong I really need to do this and I can do it. I need to upload my database to my app. I'm using this comands.

mysql --user=mediexcel2 -p --host=mysql.server 'mediexcel2$mediexceldb' < Final.sql

I been trying this too

mysql --u mediexcel2 -p -h mysql.server --databases 'mediexcel2$mediexceldb < /home/mediexcel2/Final.sql

And I get this error:

ERROR 1044 (42000) at line 1: Access denied for user 'mediexcel2'@'%' to database 'mediexceldb'

I did a dump file and it works perfect, but when I'm trying to do it backward it doesn't work, I really need help with this, I been with the same error all day.

Do you need the "--host=mysql.server" parameter?

Hmmm... playing, it would seem you do. My meagre mysql knowledge breaks down here, so I think you need to talk to the devs

@mediexcel2 -- the error message says that it's trying to connect to the database called 'mediexceldb' but your command line says 'mediexcel2$mediexceldb'.

Are you sure you're using the mysql command exactly as you put it above?

No, Giles the name of the database is that, in the database dash it says

I did it just add mysqldump at the bening, but I still have the access denied and I don't know why.

-- MySQL dump 10.13  Distrib 5.5.32, for debian-linux-gnu (x86_64)
--
-- Host: mysql.server    Database: mediexcel2$mediexcelbd
-- ------------------------------------------------------
-- Server version       5.1.63-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
mysqldump: Got error: 1044: Access denied for user 'mediexcel2'@'%' to database 'mediexcel2$mediexcelbd' when selecting     the database

I Fix it, It was a dumb thing, in my dump file I was calling to a database call mediexceldb, that was the reason in the error appears like that, so I just put the correct name mediexcel2$mediexceldb and it works ;)

That makes sense. Your database names in PythonAnywhere always have a dollar sign in them.