Problem importing MYSQL database from localhost to remote

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
whiteangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 01, 2009 3:52 am

Problem importing MYSQL database from localhost to remote

Post by whiteangel » Fri Dec 31, 2010 7:04 am

Hi,

I would appreciate if someone can help me import the MYSQL database to the remote host.

The error message that I am getting is while importing my database is:
#1044 - Access denied for user 'second'@'localhost' to database 'joomla'

I added a new user 'second' to the database 'joomla' and gave it full privileges before exporting the database to a mysql file.

Then in my remote host using cPanel, I created a new database 'second_joomla'. I cannot create a database with the exact name as the database on the localhost, it always adds the prefix 'second_'. Please see image below
Untitled-1.jpg
I cannot understand why I keep getting this error even after granting permission to user 'second' and giving it full access to database 'joomla' at the localhost. Please see image below.
localhost.jpg
I have been through the forum and tried a number of fixes but still getting the same error.
Can someone please help me out here.

Thanks
You do not have the required permissions to view the files attached to this post.

Common Panel
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Dec 30, 2010 6:00 am

Re: Problem importing MYSQL database from localhost to remot

Post by Common Panel » Fri Dec 31, 2010 8:36 am

hi white angel..

have you check this out:

http://docs.joomla.org/How_do_you_copy_ ... te_host%3F

hope that help..
Giving back to the community.

User avatar
kurchania
Joomla! Hero
Joomla! Hero
Posts: 2070
Joined: Mon Sep 21, 2009 6:56 am
Location: indore,india
Contact:

Re: Problem importing MYSQL database from localhost to remot

Post by kurchania » Fri Dec 31, 2010 9:15 am

hi whiteangel,
you do not have access to create a database without prefix second_ in cpanel.export all the table of database and import them here.
why don't you use akeeba backup for such operation.
akeeb backup http://extensions.joomla.org/extensions ... ity/backup

Regards
Abhijeet
Last edited by kurchania on Fri Dec 31, 2010 11:54 am, edited 1 time in total.
abhijeet kurchania
The future depends on what you do today

whiteangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 01, 2009 3:52 am

Re: Problem importing MYSQL database from localhost to remot

Post by whiteangel » Fri Dec 31, 2010 11:49 am

Thanks Abhijeet Guru ji

I installed Akeeba and did a back-up of the MYSQL database using Akeeba. Then I imported the database created by Akeeba into the existing database on the remote server.

It imported everything without any errors :) Although I don't understand why phpamydmin would import a database backup created by Akeeba, but it won't import the same database, if it is exported by phpmyadmin installed on the localhost. Any thoughts on that?

Now all I need to do is modify the configuration.php file to point to that database and I'm done.

Thanks Abhijeet

User avatar
kurchania
Joomla! Hero
Joomla! Hero
Posts: 2070
Joined: Mon Sep 21, 2009 6:56 am
Location: indore,india
Contact:

Re: Problem importing MYSQL database from localhost to remot

Post by kurchania » Fri Dec 31, 2010 11:54 am

hi whiteangel,
akeeba backup will create configuration.php also for you.
why you want to modify it again?
It imported everything without any errors :) Although I don't understand why phpamydmin would import a database backup created by Akeeba, but it won't import the same database, if it is exported by phpmyadmin installed on the localhost. Any thoughts on that?
your database import contain the query of create database.import simply run the query in the mysql server.in cpanel generally you are not authorized to create the name without your user prefix.that's why you get error.

make sense.

Regards
Abhijeet
abhijeet kurchania
The future depends on what you do today

whiteangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 01, 2009 3:52 am

Re: Problem importing MYSQL database from localhost to remot

Post by whiteangel » Fri Dec 31, 2010 12:22 pm

Hi,

The reason I want to modify the configuration.php file is because I did not do a full backup with Akeeba, the site was already uploaded on the remote host, so I figured why go through the trouble of doing a full backup and restore. So all I did was make a backup of the MYSQL database with Akeeba and import that into the existing database on the remote host.

Unfortunately the celebration was shortlived and I am getting an error
'Database Error: Unable to connect to the database:Could not connect to MySQL'

Could you take a look at configuration.php setting below and let me know if I'm doing this right. By the way the site rests inside the 'website' folder and not on the root.

var $log_path = '/var/www/vhost/mysite.com/website/html/logs';
var $tmp_path = '/var/www/vhost/mysite.com/website/html/tmp';
var $dbtype = 'mysql';
var $host = 'localhost';
var $user = 'second_root';
var $db = 'second_joomla';
var $dbprefix = 'jos_';

here is a screenshot of the database with the user that has access to the database
Untitled-1.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
kurchania
Joomla! Hero
Joomla! Hero
Posts: 2070
Joined: Mon Sep 21, 2009 6:56 am
Location: indore,india
Contact:

Re: Problem importing MYSQL database from localhost to remot

Post by kurchania » Fri Dec 31, 2010 12:31 pm

hi whiteangel,
1.the size of database is still 0 mb.Make sure password of second_joomla is right.
2.first have a look :-
http://docs.joomla.org/Unable_to_connec ... e_database



Regards
Abhijeet
abhijeet kurchania
The future depends on what you do today

whiteangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 01, 2009 3:52 am

Re: Problem importing MYSQL database from localhost to remot

Post by whiteangel » Fri Dec 31, 2010 12:41 pm

You were right, I missed out the password in the configuration.php file. After I entered it, the website loads fine.

As for the database size being 0. It's odd. Maybe it's because the size of the database is only 266KB.

Thanks for your help Abhijeet!
I appreciate it.

User avatar
kurchania
Joomla! Hero
Joomla! Hero
Posts: 2070
Joined: Mon Sep 21, 2009 6:56 am
Location: indore,india
Contact:

Re: Problem importing MYSQL database from localhost to remot

Post by kurchania » Fri Dec 31, 2010 12:45 pm

hi whiteangel,
Unfortunately the celebration was shortlived and I am getting an error
Celebrate again.
Close the topic by if it works for you or mark topic as solved with right button.

Regards
Abhijeet
abhijeet kurchania
The future depends on what you do today

whiteangel
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Jul 01, 2009 3:52 am

Re: Problem importing MYSQL database from localhost to remot

Post by whiteangel » Fri Dec 31, 2010 4:05 pm

How do I close the topic?

ivanzghr
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Apr 30, 2011 12:16 pm

Re: Problem importing MYSQL database from localhost to remot

Post by ivanzghr » Sat Apr 30, 2011 12:24 pm

Hi, I'm also having problem with importing db from localhost to server. On my localhost I exported db with phpMyAdmin. On my server I'm trying to import it also with phpMyAdmin. This is what I get:

Code: Select all

Error

SQL query:

-- -- Database: `andjeli_zg` -- -- -------------------------------------------------------- -- -- Table structure for table `jos_banner` -- CREATE TABLE IF NOT EXISTS `jos_banner` ( `bid` int(11) NOT NULL AUTO_INCREMENT, `cid` int(11) NOT NULL DEFAULT '0', `type` varchar(30) NOT NULL DEFAULT 'banner', `name` varchar(255) NOT NULL DEFAULT '', `alias` varchar(255) NOT NULL DEFAULT '', `imptotal` int(11) NOT NULL DEFAULT '0', `impmade` int(11) NOT NULL DEFAULT '0', `clicks` int(11) NOT NULL DEFAULT '0', `imageurl` varchar(100) NOT NULL DEFAULT '', `clickurl` varchar(200) NOT NULL DEFAULT '', `date` datetime DEFAULT NULL, `showBanner` tinyint(1) NOT NULL DEFAULT '0', `checked_out` tinyint(1) NOT NULL DEFAULT '0', `checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `editor` varchar(50) DEFAULT NULL, `custombannercode` text, `catid` int(10) unsigned NOT NULL DEFAULT '0', `description` text NOT NULL, `sticky` tinyint(1) unsigned NOT N[...]

MySQL said: Documentation
#1046 - No database selected 
I would be very grateful for help cause I need to migrate site asap. Thanks.


Locked

Return to “General Questions/New to Joomla! 1.5”