Jump to content

export database


gr3mlin

Recommended Posts

I've got a small database in phpMyAdmin. I need to export it, so I can then import it to a different server where my website is hosted.

 

When I export it, it says that it has done it successfully, but I can't find it anywhere.

 

Does anyone know where it'll go after it's been exported?

 

Cheers, James.

Link to comment
Share on other sites

Hi there,

 

it usually just shows you the text of the MYSQL database which you can copy, however at the bottom of PHPMYADMIN, there is a check(tick) box that says "export as file" just tick that, leave options as default and try it again. It should download to your pc from there...

 

regards,

-jedi.

Link to comment
Share on other sites

Thanks very much for your reply.

 

I've managed to get a copy of it, not sure if it's the correct way or not but it's saved as databasename.sql. Now when I open phpMyAdmin from the control panel the web host has supplied and go through the import process I get the following error:

Error

SQL query:

 

--

-- Database: `membership`

--

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

--

-- Table structure for table `users`

--

CREATE TABLE IF NOT EXISTS  `users` (

 

`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,

`username` VARCHAR( 15 ) NOT NULL ,

`password` VARCHAR( 41 ) NOT NULL ,

PRIMARY KEY (  `id` )

) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =2;

 

MySQL said:

 

#1046 - No database selected

 

- Do you have any ideas what's going wrong here?

 

Cheers for your help.

 

James.

Link to comment
Share on other sites

Success! Thank you very much.

 

Although I'm now getting the errors:

 

Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /home/mrandmrs/public_html/classes/Mysql.php on line 9

 

Warning: mysqli::prepare() [mysqli.prepare]: Couldn't fetch mysqli in /home/mrandmrs/public_html/classes/Mysql.php on line 20

 

Is this because the files I have on my computer have a username and password? I don't think there is one set up where it is currently hosted.

 

James.

Link to comment
Share on other sites

Ok that makes sense. Do you have any idea where I would find that information? I'm using cPanel, with phpMyAdmin version 2.11.9.5. When I have the correct settings will I just go into the page and change it around?

 

Thanks again,

 

James

Link to comment
Share on other sites

You must have a username and password from your host to access your mysql database. The address of your database, the username, and password are what you need to input. What is this database for, is it an E-commerce system or CMS? Most tools nowadays have an install script where you fill in the relevant fields with your hosts provided database details.

 

For example, if using a system like the online shop OScommerce, the install script asks you for the database server (eg. mysql12.yourhost.com or IP of host) the database username (eg. name1)  the database password and the database name (eg. myshop). All these will be provided by your host when you set up a database with them.

 

I am by no means an expert on these things but I use Mysql for the E-commerce online shops I design. This is how I usually do it, although with your database you might have to edit things manually rather than with an install script.

 

Regards,

-Jedi

Link to comment
Share on other sites

Thanks for your help with that, your experience level is far more advanced than mine. I'm only using a very simple database for a log in system. I sorted out the problem, when I has uploaded the files to the hosts server I needed to add a new user and put those details into my file!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.