store | blogs | forums | twitter | facebook | wiki | downloads | support portal
Atomic Secure Linux
It is currently Wed Aug 21, 2019 4:13 am

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Importing a .sql.gz database into a new database
Unread postPosted: Wed Dec 18, 2013 6:40 am 
Offline
Forum User
Forum User

Joined: Wed Aug 14, 2013 7:49 am
Posts: 17
Location: UK
Hello there,

I am new to this forum so please I am trying to import a WordPress database dump into a new database as a client is migrating their domain to us. I have the database dump vkjekule_srfc.sql.gz and I have created a new database for it to import into and have the following details from the wp-config.php file:

/** The name of the database for WordPress */
define('DB_NAME', 'vkjekule_srfc');

/** MySQL database username */
define('DB_USER', 'vkjekule_wp');

But I am not sure how to import this into the database that I created on our server:
salisburyrfc_wp
DB user = salrfc

Please could someone help me with the command that I need to import the database across. I think that is all the details but if you require anymore then I will provide these for you.

Many thanks,
David


Last edited by David23 on Wed Dec 18, 2013 8:27 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Importing a .sql.gz database into a new database
Unread postPosted: Wed Dec 18, 2013 7:05 am 
Offline
Forum Regular
Forum Regular

Joined: Tue Aug 01, 2006 2:45 pm
Posts: 573
Location: Netherlands
You can do it from the shell:
Code:
# First extract the gzipped file
gunzip vkjekule_srfc.sql.gz

# Then import the SQL dumpfile into your database 'salisburyrfc_wp'
mysql --user=salrfc --password=S4lrfc salisburyrfc_wp < vkjekule_srfc.sql


If you are not comfortable with the command-line interface you can use the import database functionality of a GUI client or web interface such as phpMyAdmin that is usually provided with your control panel.

Tip: never post passwords publicly.

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing a .sql.gz database into a new database
Unread postPosted: Wed Dec 18, 2013 11:01 am 
Offline
Forum User
Forum User

Joined: Wed Aug 14, 2013 7:49 am
Posts: 17
Location: UK
Thank you for this Prupert, will have a go now! Sorry they are only fake user names and passwords but I just named them so that everyone could understand the scenario and then I can replace them with the real details when the importing occurs, but thank you for the advice.


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing a .sql.gz database into a new database
Unread postPosted: Wed Dec 18, 2013 11:47 am 
Offline
Forum User
Forum User

Joined: Wed Aug 14, 2013 7:49 am
Posts: 17
Location: UK
Ok I am still a bit confused.

1. Do I have to be in a certain directory to run this command?

2. I am logged into SSH as root and need to run this command: mysql –u myuser -pmypassword salisburyrfc_wp < filename.sql but the file is root/myname/myfile.sql so do I have to do a path to the file before the filename.sql section of the command?

Many thanks,
David


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing a .sql.gz database into a new database
Unread postPosted: Wed Dec 18, 2013 12:38 pm 
Offline
Forum User
Forum User

Joined: Wed Aug 14, 2013 7:49 am
Posts: 17
Location: UK
I think I have worked out how to execute the command. Now I have run it I am getting the following error:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' at line 1

So I tried importing without the first line but that still gave me another error. I am sure I just need to take a step back and relax and then look at this again from another angle. But please if anyone can help then that would be much appreciated.

Many thanks,
David


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group