LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problem in sql database administration (https://www.linuxquestions.org/questions/linux-software-2/problem-in-sql-database-administration-64944/)

lomaree 06-11-2003 06:30 AM

problem in sql database administration
 
Hi


i can't run this file in linux . it's used to create tables in sql . createdb.sql , i want to run it without any db manager .is it possible

Hangdog42 06-11-2003 07:19 AM

You really don't provide enough details about your problem for anyone to make an informed reply. Posting your .sql file would help.

That said, I will hazard a guess. Many people use .sql extentsions on files that have a series of SQL commands. If that is what your file is, you need to have a database program like MySQL installed. There are lots of alternatives to MySQL, but basically you need a relational database program that uses SQL. Linux, all by itself, doesn't understand SQL and can't manage databases.

lomaree 06-11-2003 08:04 AM

yes it is a file that have a series of SQL commands in it. used to create a database with particular entries in it automatically.. but i can't run it how do i do that

Hangdog42 06-11-2003 08:20 AM

You need to install a database program. Check out PostgreSQL or MySQL which are both open source databases. As I stated in my first reply, Linux doesn't understand SQL so you can't just run the file. You need to install a database program that understands SQL and can manage databases.

lomaree 06-11-2003 08:52 AM

mysql is already installed in it, i mean i have installed it. i can create databases manual. but i have got this program in which it say all i have to do is run this file . but every time i run it , it does'nt do anything, it's suppose to create a database in mysql.. my question , how do i run this file .. do i have to run it within mysql if so then how

Hangdog42 06-11-2003 09:58 AM

Well, you are certainly going to want to consult the MySQL manual and read the section on batch mode. However the syntax is relatively simple:

shellprompt$ mysql -p < createdb.sql

This will first prompt you for your MySQL password, then will run the SQL commands in createdb.sql.


All times are GMT -5. The time now is 01:12 PM.