LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-09-2007, 11:29 PM   #1
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 419

Rep: Reputation: 31
Mysql question


Hey there

I am a computing student and have registered to Oracle
Well, I have a script called db.sql and i want to execute it using mysql
Could you please tell me the appropriate command to do that
I dont really know how to start mysql through the terminal window

Thanks for your time

PS:I am using Linux BackTrack (if that matters)
 
Old 01-09-2007, 11:41 PM   #2
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
If MySQL is already installed, you start the daemon with something like (as root):
Code:
service mysqld start
and you get to a mysql prompt where you can enter your SQL commands using just 'mysql'. Type 'mysql --help' for more options.
 
Old 01-10-2007, 02:22 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I don't think that it's a script, but a dump containing SQL queries that will probably populate a database. If so:

It might work but don't expect it to work as there might be differences between Oracle and MySQL.

The command to load your SQL file is
Code:
mysql < db.sql
You might have to pass a few options to mysql like the user and the database to use.

You can read more in the mysql manual (chapter backup and recovery). If you don't have it, I strongly suggest that you download it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
MySQL Question NoBrains Linux - Software 2 03-01-2004 11:10 PM
MySQL question Citizen Bleys Programming 2 08-15-2003 07:07 AM
Another mysql question dkc_ace Linux - Software 0 03-23-2003 05:10 PM
MYSQL Question stayathomemom Linux - Newbie 0 02-09-2003 06:52 PM


All times are GMT -5. The time now is 08:47 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration