[SOLVED] Creating mysql db user

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

yaron wrote:GRANT ALL PRIVILEGES ON *.* TO stam@localhost
IDENTIFIED BY '5194351' WITH GRANT OPTION;
Just FYI: That grant gives the stam user ANY right on ANY database and ANY table, meaning it has superuser like access.. It does not make much sense to do this in a scripted environment... if you do want to give someone full rights to their own database, dont grant ON *.*
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

Post by yaron »

Just one more Q about th syntax of Grant.
What comes after ON?
*.* means all databases and all fields?
car I ristrict to spcific databases or certain fields?
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

most answers are in the manual..

Usually you have already selected a database (mysql_select_db()), so if you do NOT use any dot in the ON clause, just enter table nams or a single * for all tables within the database.. if you grant to multiple databases do that with ON db1.*,db2.* and so forth
yaron
Forum Contributor
Posts: 157
Joined: Fri Aug 22, 2003 8:40 am

Post by yaron »

Thnaks a lot to all
problem solvd!
Post Reply