473,766 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error while running createdb from a batch file in windows xp

7 New Member
Hi,

I am installing postgreSQL 8.2 using batch files in windows xp machine.

I am installing postgres using postgresql-8.2.msi installer.
Installation was successful.

When i tried to run createdb command
using the following command from another batch file
"createdb -U dbname username"

command prompt asked me to enter password for the username

Is there a way to avoid this password prompt.

This command works good in windows 2000

Thanks in Advance,
Anand
Aug 17 '07 #1
5 8204
michaelb
534 Recognized Expert Contributor
Unless you set up your database access with the "trust" option this prompt is probably asking for your password, not the password for the username you passing to the createdb command.

Look at pg_hba.conf file, or simply run something like psql -l - would you be prompted for password?

If this is the case you can either change your access mode to trust instead of password, or put something like this in your batch file:
set PGPASSWORD=my_p assword

Obviously you may need to consider the possible security issues arising from these actions.
Aug 18 '07 #2
michaelb
534 Recognized Expert Contributor
And by the way, the code snippet for createdb command you posted is incorrect:
>> createdb -U dbname username
The correct format is
createdb -U username dbname
so make sure you call it correctly. Try "createdb --help" for more info.
Aug 18 '07 #3
anand4nk
7 New Member
Thanks Michael.

You guessed it right.

I changed the line in pg_hba.conf file from

host all all 127.0.0.1/32 md5
to
host all all 127.0.0.1/32 trust

and the problem got solved.

Sorry for the mistake i made in createdb syntax.
My batch file syntax was right. I quoted wrong to the forum.

Once again, Thank you very much...
Aug 20 '07 #4
michaelb
534 Recognized Expert Contributor
No problem, you're very welcome!
Aug 20 '07 #5
kenatsun
1 New Member
I'm pleased to confirm that the solution of adding

set PGPASSWORD=my_p assword

to your .bat file works fine, too. Thanks for the tip!

~ Ken
Jan 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5038
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
5
7042
by: Patrice FRITSCH | last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object. Dim oWSH set oWSH= Server.CreateObject("WScript.Shell") call oWSH.Run("cmd.exe /c " & szCmd , 0, true) szCmd contains the program to execute (fop.bat with several parameters). But I'm getting the following error message :
5
2789
by: Ken Cox [Microsoft MVP] | last post by:
MS has posted this here: http://www.asp.net/faq/ms03-32-issue.aspx Fix for: 'Server Application Unavailable' Error after Applying Security Update for IE ------------------------------------------------------------------------------- -
6
3514
by: AlanS | last post by:
I have used Visual Studio for about 8 months. I have developed some ASP solutions. I had to get on with some other things and have not worked with ASP.NET for a couple months. In the meantime, I have upgraded to .NET Framework 200 V1.1. Over the week end I had to go back to work on a project that needed some changes. I get the following error when I try to open an existing project or create a new one. I have XP Professional An error...
5
310
by: Martin Robins | last post by:
I have never dabbled with ASP.NET until now so be warned! I have created a web application with the single default form: WebForm1.aspx and when I try to display it I get this error. My understanding was that ASP.NET was supposed to set itself up, especially as I am using Windows Server 2003. Can anybody give me instruction as to resolution; what folder should I be granting the access to? The path shown only exists as far as the...
8
10015
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500 Internal Server Error'."
3
2228
by: Anony Mous | last post by:
Hi, I've run into a problem. I've had postgres V8 beta on my WinXP Pro machine for some time now, and it's been running great. Now, for some reason, I cannot issue any queries to the database via psql. See snippit below... ------------ C:\Program Files\PostgreSQL\8.0-beta1\bin>createdb -U postgres test CREATE DATABASE
0
1578
by: -pb- | last post by:
Hi, I have developed a web site for my client on .net 2.0 framework using asp.net 2.0. This web site will be hosted on Windows 2003 server. Web application runs the batch file on the user button click. This batch file runs isql, isqlw or bcp utility of sql server to pull the data from database. This command generates the .csv file by executing the query.
1
7841
by: johnyjj2 | last post by:
Hello! I've got web application created for MSSQL and IIS. There are two directories in this application - Scripts and WebSite. In Script there is file CreateDb.sql. I need to run it so that it can create database. I changed in that file one line into this: CREATE DATABASE ON PRIMARY ( NAME = N'NameOfDb', FILENAME = N'F:\Inetpub\wwwroot\htdocs\WebSite\NameOfDb.mdf' and the other part for the same directory but other filename...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.