472,111 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

setting database pw

hi,

i've searched quite a bit, but cant find any post relating to sql
command for setting database passwords. anyone know how? thanks

pk

Nov 23 '05 #1
4 1837
You can only set passwords for user accounts, not for specific databases:

set password for user@host = password('your_password');

Find more detailed information here:
http://dev.mysql.com/doc/refman/5.0/...anagement.html

Markus
Nov 23 '05 #2
thanks for the reply markus.

i was under the same impression, but i set up a wiki on my server and i
noticed that the mysql_connect command the wiki uses doesn't
authenticate with my mysql server password.

when i initally set up the wiki, it asked me to create a pw for the
wiki DB. this pw was not my mysql user pw.

how is it still able to query the wiki db (without my mysql user pw)
then?

i also wrote my own php script and provided the wiki DB pw to the
mysql_connect command. the connection surprisingly also worked.

// case A:
$link = mysql_connect('localhost', 'mysql_user', 'wikiDB_password');
mssql_select_db('[wikiDB]', $link); // success

// case B:
$link = mysql_connect('localhost', 'mysql_user', 'wikiDB_password');
mssql_select_db('[anotherDB]', $link); // fails as expected - didnt
create pw for this DB

i shutdown my wiki and restarted it before trying the above too. how is
this possible? case B makes me think you can set DB specific pw...?

thanks in advance,

pk

Nov 24 '05 #3
On Thu, 24 Nov 2005 14:20:47 -0800, pk_pk wrote:
...case B makes me think you can set DB specific pw...?


Part of the user permissions is which databases can be accessed, and in
what capacity (read-only, update, drop, etc.)


Mike A.
MySQL 5.0.15 on FreeBSD 5.4

Nov 25 '05 #4
thanks markus and mike =) i looked more carefully into the link markus
pasted, and there is mention of "user permissions is which databases
can be accessed" with the "GRANTS" command.
kani

Nov 28 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Fran Tirimo | last post: by
4 posts views Thread by Phil Campaigne | last post: by
1 post views Thread by Suresh | last post: by

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.