LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-30-2012, 10:45 AM   #1
amritpalpathak
Member
 
Registered: Feb 2010
Posts: 116

Rep: Reputation: 15
How to Generate Database Script in Mysql in Ubuntu?


I am using ubuntu 12.04 having mysql installed.I need to make a script of database named 'information' including its all tables and data so that i can execute it on other Systems and can get everything as it is.
Can anyone please tell me terminal command for that ?
Thank you in advance.
 
Old 11-30-2012, 10:55 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
terminal >
Code:
sudo mysqldump -uroot -p information > /path/to/information.sql
at the other end:
Code:
sudo mysql -uroot -p information < /path/to/information.sql
 
1 members found this post helpful.
Old 12-01-2012, 10:33 AM   #3
amritpalpathak
Member
 
Registered: Feb 2010
Posts: 116

Original Poster
Rep: Reputation: 15
I used this command

sudo mysqldump -u root -p Shoppingportal > /var/www/information.sql;

And it gave me following error.Can you please tell why?

bash: /var/www/information.sql: Permission denied
 
Old 12-01-2012, 08:09 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
I used this command

sudo mysqldump -u root -p Shoppingportal > /var/www/information.sql;

And it gave me following error.Can you please tell why?
Not sure, but I have a feeling that it's either the ";" in command or the redirect (">") (sudo+redirect could be 'iffy')

Try
Code:
sudo mysqldump -u root -p Shoppingportal > /var/www/information.sql
or quite possibly
Code:
sudo "mysqldump -u root -p Shoppingportal > /var/www/information.sql"
 
Old 12-03-2012, 02:01 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I wouldn't normally recommend writing a DB dump to the web docs area; is this being called via php from Apache by any chance?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot get my php script to UPDATE mysql database countrydj Linux - Software 2 04-11-2011 09:09 PM
How to generate and format a report from Ubuntu database into Open Office arthurab Linux - Desktop 1 10-07-2010 08:45 PM
Any advice on software to generate online reports from a MYSQL database? will103 Linux - Software 1 05-07-2010 03:29 PM
how to interact with mysql database using shell script vinaytp Linux - Newbie 3 04-24-2009 07:46 AM
Cannot connect to mysql database using php script shan_nathan Programming 4 10-17-2008 11:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration