gr3mlin Posted June 23, 2009 Share Posted June 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/ Share on other sites More sharing options...
darkjedig Posted June 23, 2009 Share Posted June 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862122 Share on other sites More sharing options...
gr3mlin Posted June 23, 2009 Author Share Posted June 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862137 Share on other sites More sharing options...
Dathremar Posted June 23, 2009 Share Posted June 23, 2009 You need to create the database 1st. Then select the database and use the sql file in the SQL menu Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862140 Share on other sites More sharing options...
gr3mlin Posted June 23, 2009 Author Share Posted June 23, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862147 Share on other sites More sharing options...
darkjedig Posted June 23, 2009 Share Posted June 23, 2009 Hi again, you need to look at: Access denied for user 'root'@'localhost' (using password: YES) you need to use the database settings from your hosting company. 'root'@'localhost' is your local PC. regards, -jedi Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862150 Share on other sites More sharing options...
gr3mlin Posted June 23, 2009 Author Share Posted June 23, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862170 Share on other sites More sharing options...
darkjedig Posted June 24, 2009 Share Posted June 24, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-862535 Share on other sites More sharing options...
gr3mlin Posted June 29, 2009 Author Share Posted June 29, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/163393-export-database/#findComment-865791 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.