Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Import in sql - phamydmin

Post Reply
bojanf
Posts: 1
Joined: Fri Feb 10, 2012 2:08 pm

Import in sql - phamydmin

Unread post by bojanf »

Hello!
I read all the forums, but can not find the solution to my problem! NuBuiler I easily installed the on my local computer but when I try to import the sql database sample.sql, the public server, let me know the following error ...

CREATE DATABASE IF NOT EXISTS sample;

# 1044 - Access denied for user 'stroko1' @ 'localhost' to database 'sample'

My settings:
folder / public_html / nuaplikacije
DB = stroko1_sample
user = stroko1_admin
pass = stroko1_admin

I know that I need to change later in config.php
$ DBHost = "127.0.0.1";
$ Dbname = "stroko1_sample";
$ DBUser = "stroko1_admin";
$ DBPassword = "stroko1_admin";
$ DBGlobeadminPassword = "sampleglobeadmin";
/ / $ DBSiteGlobeadminPasswordOnly = true;

I tried all the variants, but unfortunately nothing works.

Please Help

Thank you
pickle_jimmy
Posts: 38
Joined: Mon Jul 25, 2011 4:00 am

Re: Import in sql - phamydmin

Unread post by pickle_jimmy »

This answer is designed to help all CPanel users...

On CPanel accounts, the mysql databases (and database users) are prefixed with your username.

Bojanf's is stroko1 and so the sample database is not called "sample" is is called "stroko1_sample"

The second issue is that CPanel accounts do not allow you to create databases and users willy-nilly; they have a section for doing this, which forces the addition of
the username to the front of your databases.

The problem is that at the top of the supplied databases are a couple of lines that fail if you try to import the data BECAUSE they try to break CPanel's rules.

CREATE DATABASE IF NOT EXISTS sample;
USE sample;
CREATE USER 'sample'@'localhost' IDENTIFIED BY 'samplepass';
GRANT ALL PRIVILEGES ON `sample` . * TO 'sample'@'localhost' WITH GRANT OPTION;

Yes, they try to create a database and a user.

If you remove these lines from the top of the .sql file, you can then use PHPMYADMIN to import the sql into your required database.

Then, as long as you have the correct settings in your config.php file to connect to the database you created in CPanel, you should be cooking with gas.

Cheers

Pickle Jimmy
Post Reply