Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




People Store Passwords In Database


i used to store the password in database using md5() function but there is no way to retrieve the

password back.

Now i want to know that -
is it standard and secure way to store password?
is there any other technique to store password so i can retrive it back?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Encrpyt Passwords In Database?
I'm making a user login system with PHP/MySQL & when users sign up & such I want their password put into the database & encrpyted... how do you do this?

Why People Reject MySQL 5
In the past months I have migrated to MySQL 5 and have not looked back. However over the past few projects I have encountered the development teams/clients prefer I use MySQL 4. There is a lot of varied reasons for this, but am confused whether this is just developers reluctant to update their code or in fact a fundemental issue.

Can anyone suggest why they would prefer MySQL4 over MySQL5?

Determining Which Age Ranges Have People In Them
Making up another example here since it makes things clearer for everyone.

I have a people table. One of the fields in there is 'age' (as an integer). I want to output a series of links like the following:

People by age:
21-30
31-40
51-60

Each range would be a link to a listing of people in that age range. They stumbler for me is that I want to only show age ranges that have people in the table in that age range.

So above, the 41-50 range didn't show up because nobody in the people database had an age in that range.

I don't know how to do this without 10-11 queries each checking a range and counting the numrows returned. And I just know if I hardcode the last year to 150, there will suddenly be a need for a 151-160 range.

Any elegant way to do this without a loop or a dozen+ queries?

Need Some Help In Improving Performance On A Query (was: Hi People)
I need some help in improving performance on a query which is taking too long to execute.

I have 3 tables:
table 'photo' stores information on photos and it has 2 important fields:
- photo_id
- title

table 'item' stores information on generic items in the system (photos is an example). It has 3 important fields:
- item_id
- item_type (like 'photos')
- submitter_id

table 'user' stores information on users in the system. It has 2 important fields:
- user_id
- name

I would like to get the number of photos that either have a title that contains 'a' or the submitter's name contains 'a'

I tried the following:


SELECT count(DISTINCT photo.photo_id) NumItems
FROM (photo, item, user)
WHERE (item.item_id = photo.photo_id AND
item.item_type = 'photos' AND
(photo.title LIKE '%a%' OR (user.name LIKE '%a%' AND user.user_id = item.submitter_id)));
This query is taking way too long (sometimes up to 10 seconds
Note that I have over 2,000,000 records in the 'user' table (I suspect the problem is there)
I only have 2 recods in the 'photo' table
I only have 2 records in the 'item' table

How Can I Store Items In A Database Like
Okay lets say I want to store a poem in the database like:

roses are red
voilets are blue
sugar is sweet
and so are you

And I want the spacing to be like that.. and when I call it with php it show like that with the spacing?

Phpmysql Query, Delete All People Not Logged In
I wish to run a sql query on my databse

Delete from Table: customers AND Table: customers_info

Where customers_info_id AND customers_id are the same

and

customers_info_number_of_logons = 0

This will remove all users that have not logged on, I would like to run this as a cron job as well but one thing at time....

Store Files To Database Or To Filesystem?
I need to store and retrieve files from HTTP server. I created table in the database with MEDIUMBLOB being one of the columns. Now I have second toughts weather I should store files in database, or store only meta data in database while keeping the file content on the disk.

If I store all data in the database it should be easier to maintain. I'm worried about performance.
If I store file content on the disk it should be easier to make partial backups but more care should be taken when syncronizing.

Here are the numbers: I expect that 80% of files will be 10 kB - 100 kB in size and there should be 10000 - 100000 files. I am reading articles on this topic, but they are all inconclusive. I would like to know, from your own experience, what do you find better: to store it all in a database (would you use MyISAM or InnoDB) or would you store file content on the disk?

(I am using foreign keys but decided to go with MyISAM because of the performance gain; extra caution is taken in the PHP to keep data integrity)

I Want To Store Date With Curdate + Coming 1 Month In Database
I want to insert curdate with upcoming 1 month in the database.

For example: Actdate= 2006/12/20 expdate=2007/01/20

But it will generated auto to save in database,

My code is:

Can A MySql Database Store A Long Paragraph Of Text
Can a MySql Database Store a long paragraph of text, If it can, how do you go about doing this. And how many "CHARS" can you store in a "FIELD".

Store Links Inside The Main Text In A Database
we are trying to set up a mySql database while rebuilding a webpage
with lots of content.we actually dont know how to set up the tables for
that and especially how to store links inside the main text?should we
use xml files to store the text with embedded links?

Adding Different Size And Price Options To An Online Store Database Structure
At the moment I have an online store all up and running that sells oriental rugs, but based on the assumption that each design is available at a single size and a single cost.

The site has an admin section where the site owner can add new designs using a fairly simple insert form, filling in various details including size and cost, which adds a new record in a simple 'Carpets' table.

What would be the best practice to add in the ability to specify different sizes, with different prices? I'm presuming I'm going to need at least one new table, ie split it out into Carpets and Carpet_Sizes perhaps?

Carpets
Carpet_ID
Design_Ref
etc

Sizes
Carpet_ID
Size
Price

With a query Carpet_Sizes :

Carpet_ID, Design_Ref, Size, Price
1, ABC1, 6x4, 599
1, ABC1, 2x3, 199
1, ABC1, 5x4, 399
2, ABC2, 6x4, 899
2, ABC2, 2x3, 599
3, ABC3, 5x4, 799
3, ABC3, 6x8, 999

What would be the easist way to allow the owner to add this info when adding new designs? Using checkboxes perhaps?

Passwords
1. I know in mySql you need a username and a password to access a database. However, can you set a username and password (or even just a password) to access a table or a row?

2. Is there a way you can set a database so you can only add data?

3. is there a way I can have people access values to a database (php) without using a password?

4. is there a way to set up diffrent users (with diffrent permissions) for accessing mySQL data?

5. Any comments about how I can get alot of people accessing a database, from diffrent websites, with keeping i as secure as possible?

Passwords
i've written a windows based from end for a mysql database that will work across a local intranet, it stores usernames and passwords for a reporting system, what is the best way to store the passwords int he db? i.e encrypted or?

Passwords & DBI/DBD
I installed the current stable release of MySQL from RPMs. I used the client
and server packages.

After installing the server package, the RPM printed a note saying I should
run two commands. I only got the first one, which was
# ./mysqladmin -u root --password
I assume this gave the root user a password.

I then downloaded and proceeded to compile the Perl DBI and DBD:mysql
packages. The DBI package installed fine after I also installed the
"MySQL-devel" RPM. Code:

Passwords
I want to store some passwords in a MySQL table. Is there any way of
preventing someone using say COntrolcentre from viewing the passwords.

Passwords
I am just starting out using mySQL. I created some databases and tables and
installed mySQLcc to ease my usage. After about 4 months, I've needed to
make some changes that needed root access. I appearantly wrote down the
wrong password so I couldn't make any changes. In the process of trying to
change the password I think I changed it again and unsynced mySQL and
mySQLcc because now I can't access any of the databases with any user.
Although I can still open mySQLcc, it can't connect to the database. I get
access denied no matter what I do. Is there a way to clear the passwords
and start over? Where are the passwords kept? Or do I have to remove
mySQL and reinstall it and start over?

Transferring Passwords
I tried doing a search but did not find the answer I was looking for.

I just redesigned the database that I had created a few months ago. I broke my one single table up into multiple tables.
My problem is that in my old large table I had a password column that is populated by using Password(). Is there a way for me to transfer the info from that column to my new broken down table set?

I did not create a new database when I broke up the large table, I just built my new tables around it so they are all stored in the same database. I'm not sure if that makes a difference or not.

Is it possible for me to just copy and paste the info from one of the fields into the new table? Or will that break the encryption?

Passwords For Myadmin
I am looking for a way to setup a username/password to myadmin. I made the mistake of showing other the website for admin work and now they are messing it all up.

Inserting Passwords Into DB
I have a couple of questions concerning the insertion of encrypted passwords into a mysql database (4.0)
first, some admins seem to think it's a good idea to feed the password in plaintxt to the db and have the db encrypt and store it. I tend to think this is less secure seeing as there is no seperation between the data and the encrypt/decrypt

so therefore encrypt the password beforehand and I want to insert nand retreive it that way. What type should I be using with the store, and what's the best way to store and retrieve it with that type?

Passwords / Authentication
I have just started messing around with MySQL and something I find weird is that we connecting using localhost, if I supply the password, it will not authenticate...if I leave the password off, it's fine.If I connect from another machine, it requires the password or it will not authenticate.Is that normal?

Transferred DB, Now Passwords Not Working..
We just switched hosting companies and transferred 3 of our DB's from the old server to the new. Everything seemed to go alright. Our sites are reading from the DB's however none of the users from our DB can log into the website.

When a user signs up to the site we use the MYSQL PASSWORD() function to enter the users passwords into the DB.

Encripting Passwords In Mysql
Is there any way to encript a password in a mysql database, so that if anyone looks in the database, they wont know peoples passwords?

Encoding Passwords In MySQL
I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I want to be able
to email the users password back to them should they forget their old
password.

I looked at how to store the password data in MySQL and they recommend
using MD5 or SHA. Both of these appear to be one way encryption
routines. IOW once I encrypt and store the users password there is no
way to unencrypt it.

How can I store passwords in my SQL database such that I can convert
them back to plain text when the user requests them?

Encoding Passwords In MySQL
I am developing a database application in which I store usernames and
passwords. Naturally I want to store the passwords in an encrypted form.
However, just like you see in many web applications, I want to be able
to email the users password back to them should they forget their old
password.

I looked at how to store the password data in MySQL and they recommend
using MD5 or SHA. Both of these appear to be one way encryption
routines. IOW once I encrypt and store the users password there is no
way to unencrypt it.

How can I store passwords in my SQL database such that I can convert
them back to plain text when the user requests them?

Problem With (hashed) Passwords
I my program I have my own login form from which I forward username and password to (ADO)ConnectionString, and then make Connection Active.
But, MySQL Server reports error 'Client does not support authentication protocol requested by server; consider upgrading MySQL client'
Newest version of server (and client) is installed.
Help says that server uses hashed password when user is attemp to connect.
How can I provide hashed password from my application?

User Accounts With Passwords
I am able to connect to the database using users that are not password protected. After updating privileges to use passwords and changing login info(in a php document) I recieve the following error from the php document:

Warning: mysql_query(): Access denied for user 'ODBC'@'localhost' (using password: NO) in c:inetpubwwwrootgindex.php on line 9

Warning: mysql_query(): A link to the server could not be established in c:inetpubwwwrootgindex.php on line 9

I am attempting to connect as 'test'@'localhost' with the password 'test'. If I remove the password, I can connect no problem.

Can't Add New Users & Passwords To Grant Table
I am running MySQL 4.1.7 on my Windows XP system. I can create databases, ect. on the command line, but when I try to run a PHP script I receive the 'Access denied' error message. I have tried using the Grant command to add a new user but nothing comes up when I show SHOW GRANT except the root user. How do I add the new users for running the PHP script?

Security For Shared Server.xml Passwords
I have an ISP that has the server.xml in a shared environment. The server.xml file is where my password is available for database access under connection pooling. I really would like to use connection pooling.

Does anyone know how I can protect my password from being viewed by others using the same server.xml file? I cannot get the administrator to change the protection of the file because others in the shared environment need to be able to view it.

Hide Mysql Usernames And Passwords
I'm trying to have people access a secure mysql database. If they get to a certain webpage, they have clearance to access the database, and we have one password and one username (that the users do not know). Does anyone know how to have it so the people cannot see the cgi script to access the database?

User Passwords Lost On Reboot
Server 2003 | IIS6 | MySQL 4.1.14-nt-max | phpMyAdmin 2.6.4-pl3

Apart from root, I have only 6 databases and whenever I reboot the server, I have to reset the passwords on 4 db's (using phpMyAdmin). Checking the mysql db, user table I note that the 4 that are causing problems have an asterix *preceding the encrypted password. The passwords that do not change were set with the help of a friend using SQL statements.

Mod_auth_mysql Or Mysql Usernames And Passwords
I'm writing a web app that needs a login page. I'm doing the dev on a
windows box although the final version will go on a Linux box. I can't
find any versions of mod_auth_Mysql precompiled for windows and have no
idea about compiling c.source on windows (or anything to do it with).

Is there a good reason I shouldn't store hashed password in MySQL and
call them from Python scripts instead of using the apache auth module
directly?

Passwords, Permissions, And Blank Users
I have Apache 2 server, PHP5, and the latest MySQL installed on my system. I'm currently reading PHP and MySQL for Dummies (I told you I was a newbie) and trying to work through a few of the examples.One thing I noticed when I looked at the "users" table in the "mysql" database is a blank user with all privileges on localhost. I deleted that entry, set a password for my "root" account, and created another account with a non-blank password.

The problem I am having is that I am trying to connect to the database as "root" with a blank password, and it's still working. I then tried a blank user, and it worked. I tried a random assortment of letters and numbers, and it worked.

Creating List Of People Not On List
I am using the following query to try to get a list of people not in a specific list. I can further restrict it by company name but I am getting duplicate entries if the person is listed on multiple lists. (It is further reduced by a clause to restrict by company, but that is not causing errors AFAIK)

SELECT people.`First Name`, people.`Last Name`, people.PersonID, Company
FROM people LEFT JOIN listtrack ON people.PersonID=listtrack.Person_ID
WHERE (listtrack.List_ID<>4 Or listtrack.List_ID Is Null)

If I remove the List_ID<>4 clause then I get people who are not on any list., but I want to be able to add one person to multiple lists, without running the risk of data duplication.

Switched To 4.1, Now Passwords Work Differently - How To Adjust?
I switched from MySQL 3.23 to 4.1. I used Pear DB but now, it doesn't seem to work so I switched to Pear MDB2.

I used MySQL Control Center to add a new system user to the MySQL user table but the password was like an nd5 hash instead of the old 16 character password in version 3.23.

When I try to connect it indicates it can not connect.

Binary Column Types / Hashed Passwords
I'm building an asp.net application using MySQL as the database. I've created a table to store usernames and passwords. During user creation and authentication - i'm presenting the db with a hashed password value.

When a hashed password is stored in a db - how should it appear in the table?

In the MySQL table I'm using to store username and passwords, it appears as
system.byte[]. The data type is defined as varchar(16), binary. The field is not behaving as it should during authentication - as long at I enter a valid username, the system authenticates me despite a correct or incorrect password value.

Can anyone help me to define the appropriate column type? My application works fine w/ MS SQL but fails w/ MySql. In MS SQL the field is described as:[PWD] [binary] (16) NULL

Packed Passwords In Command Line Programs
I think this is a trivial newbie question but can only be answered by a guru.

In command line programs, why should passwords be packed with the parameter name?

For example for mysqlimport one would write the command like that:
mysqlimport -u user -ppass

Why not just
mysqlimport -u user -p pass

?

Repost:Binary Column Types / Hashed Passwords
I'm building an asp.net application using MySQL as the database. I've created a table to store usernames and passwords. During user creation and authentication - i'm presenting the db with a hashed password value.

When a hashed password is stored in a db - how should it appear in the table?

In the MySQL table I'm using to store username and passwords, it appears as
system.byte[]. The data type is defined as varchar(16), binary. The field is not behaving as it should during authentication - as long at I enter a valid username, the system authenticates me despite a correct or incorrect password value.

Can anyone help me to define the appropriate column type? My application works fine w/ MS SQL but fails w/ MySql. In MS SQL the field is described as:[PWD] [binary] (16) NULL

Store PDF In DB?
I am writing a web application that is actually an application for a school, causes some word confusion...
Anyway, applicants need to be able to upload PDF statements and letters of recommendation and such. The applicant can re-upload the file multiple times with corrections, but only the most recent version will be kept. When the application is finished the PDF will be accessed a few dozen times by various reviewers.
For easy backup/maintenance/organization it would make my life much simpler to store the PDFs directly in the database, however I gather that there may be problems with this. The only stats I can find seem to worry about scaling with dynamic content being loaded for thousands of visitors, however I don't need to worry about that as only a few dozen folks will want to view any given file, over several weeks.
Aside from scaling is there any other reason to avoid storing the PDFs in a BLOB? Will the performance hit be that significant?

How To Store
An user fills a form. My script generates a reference, call it REF. There's also another value which is the same for each REF, call it REF2. The script also generates a date value, which should be stored for each form filled and may have different values for the same REF, call it DATE. Then there's three more values which are come from what's filled in the form, so values may vary for the same REF, call them VAR1, VAR2 and VAR3. When I search the database, I will look for REF.

To sum up, each REF2 is always the same for one given REF; and DATE, VAR1, VAR2 and VAR3 need to be findable when I have the REF value.
By the way, all of these are VARCHARs (but for DATE which is a, well, DATE).

The Best Way To Store Sub Categories
I am setting up a system where users can select a main department and then a sub-category of that department. I currently have a department table that holds the main departments.

=============
id | department |
=============

If I put the sub-categories in the same table I am not sure of how to relate them to the main department. Is the best solution to put the sub-categories into another table with a department id column to reference the main department.

==========================
id | sub-category | departmentID |
==========================

Best Way To Store This Data
I'm doing a bit of a site where users can upload replays of games. The table (called 'replays') will have fields like id, name, date_uploaded .... which take up about 10 feilds.

But there also has to be a way to store data on each player. There can be up to 8 players in a game and the database must somehow record:

a) the name for each player
b) a rating for each player
c) and a second rating for each player.

Any tips on how to do this? I cant imagine having a database with 40+ feilds called player1rating1, player1rating2, player2rating1

How Do You Know WHEN To Use STORE PROCEDURE
I need to execute sql and pass two application variables' values to sql, so that every row of record, with field commission, is summed with two additional app variable values.

Do I need stored procedure?

Best Way To Store PRICES In DB
Should I use INT, DECIMAL, CHAR? to store a prices in the database?

How To Store Jpg In MySQL?
How do I store pictures in mySQL? What is the data type for this field?

Store SQL Procedure
I need to log all sql statments that are performed on a database using PHP, and so i am playing on storing them in a mysql table. Is there a way that i can store a sql statement without it trying to execute?

Store A Number
How do i store a number into MySQL and then reacal it later for use and/or editing.

Store DB For Each Domain
if there is a way to set up MySQL server to keep DB's for one user in it's home folder?

I wonder how those virtual (shared) hosting companies set it up?

What I mean is say if I have two users (domains) on the server they will have all their files in their home folders.

/home/domain1.com/
/home/domain2.com/

I ask this because I find it neat to have all the files for one domain in one place - mostly for backup.

Format To Store IP
I need to keep a database of IPs and check if a new IP is there or not.
I was wondering what's the most efficient way to store an IP in a database to make searching most efficient. Would it be better to hash the IP or just keep it as it is or some other way perhaps?

Store A Select
For instance, I have;

@a:=(SELECT * from @n)


@n is the variable that has the name of the table inside.

Is this possible?


Copyright © 2005-08 www.BigResource.com, All rights reserved