Import Problem

[expired user #2797]'s profile image [expired user #2797] posted 17 years ago in Import/Export Permalink
Hello- Well I have created my first Rails app and am using HediSQL for the MySQL front and when I export my SQL file locally from HediSL and then import it in phpmyadmin on my site I get an error. Here is the error:

Code:

Error
SQL query:
#
# Database structure for database 'databasename'
#
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `jobs` /*!40100 DEFAULT CHARACTER SET utf8 */;
MySQL said: Documentation
#1044 - Access denied for user 'username'@'localhost' to database 'databasename'


Can anyone explain how I can export the SQL file from HediSQL and then upload it to the PHPmyAdmin on my site? Thanks.
ansgar's profile image ansgar posted 17 years ago Permalink
The message is taken from some documentation, right? If yes, you should post the exact message which HeidiSQL gives you. I have a slight feeling it was a different one because it doesn't fit to the CREATE DATABASE command.

However, HeidiSQL is not the cause of the error here. I guess you need more privileges on the target server.
[expired user #4769]'s profile image [expired user #4769] posted 14 years ago Permalink
Hi,

I have also some problems with importing sql files. Problem is that there is no error message, but the tables aren't created - database itself is dropped and created afterwards. First it occurred with a file of a friend and then I tested an export file from HeidiSQL itself.
Here the first lines of the exported file:
# --------------------------------------------------------
# Host:                         localhost
# Server version:               5.1.41
# Server OS:                    Win32
# HeidiSQL version:             5.1.0.3344
# Date/time:                    2010-05-26 23:13:25
# --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!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' */;
# Dumping database structure for db
DROP DATABASE IF EXISTS `db`;
CREATE DATABASE IF NOT EXISTS `db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `db`;

I checked the versions and they are correct.

I also tried to run it create statement for create statement - that works even sometimes when I tried more than one statement, but usually not.

Insert statements are done well.

Any suggestions?
ansgar's profile image ansgar posted 14 years ago Permalink
No clue. Could you post at least one CREATE TABLE query of that import file?
[expired user #4769]'s profile image [expired user #4769] posted 14 years ago Permalink
Here the first lines (including a create statement:
# --------------------------------------------------------
# Host:                         localhost
# Server version:               5.1.41
# Server OS:                    Win32
# HeidiSQL version:             5.1.0.3344
# Date/time:                    2010-05-26 23:13:25
# --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!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' */;
# Dumping database structure for db
DROP DATABASE IF EXISTS `db`;
CREATE DATABASE IF NOT EXISTS `db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `db`;
# Dumping structure for table db.assi
DROP TABLE IF EXISTS `assi`;
CREATE TABLE IF NOT EXISTS `assi` (
`PerslNr` int(11) NOT NULL,
`Name` varchar(60) NOT NULL,
`Fach` varchar(60) DEFAULT NULL,
`Boss` int(11) DEFAULT NULL,
PRIMARY KEY (`PerslNr`),
KEY `Boss` (`Boss`),
CONSTRAINT `assi_ibfk_1` FOREIGN KEY (`Boss`) REFERENCES `professoren` (`PersNr`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


I also tried to order the create statements by neccessary references, but it didn't worked either.
ansgar's profile image ansgar posted 14 years ago Permalink
I have stripped the 3 database queries and executed the rest in a test database. I cannot reproduce any error here. Table "assi" was created and editable here - of course after having refreshed the table list.
ansgar's profile image ansgar posted 14 years ago Permalink
Please check what you have set as delimiter in HeidiSQL by clicking the main tool button with the red semicolon on it. I guess you have set it to something else than semicolon, which makes the SQL splitter stop at the wrong offsets.

Please login to leave a reply, or register at first.