Conjurer Posted October 20, 2003 Share Posted October 20, 2003 This is definitly a newbie question, but you gotta start somewhere. I have worked with a lot of SQL all the way back to Rbase so I am not new to the database design and know the syntax. Problem is I have always been the sole user of those databases and have never had to deal with someone else connecting to it. I am working through the PHP Freak\'s Membership tutorial. In the db.php file that you include you set up the variables to run the connection to the data base. I set my initial trial up using the following: $dbhost = \'localhost\'; $dbusername = \'root\'; $dbpasswd = \'xyz213\'; $database_name = \'freaksmembers\'; So my question is when I end up setting this up on a real website how should I change this so they don\'t log into the root? Assuming the website is at www.mydomain.com do I just set up a generic user for connecting ike \"Webentry\" assign a password like abc123 and then change the db.php include variables to: $dbhost = \'www.mydomain.com \'; $dbusername = \'Webentry\'; $dbpasswd = \'abc123\'; $database_name = \'freaksmembers\'; Would appreciate any suggestions that will help me take this over to the my webhost\'s site. I am especially concerned that I don\'t set myself up for a security problem. Thanks Quote Link to comment Share on other sites More sharing options...
Derek Posted October 20, 2003 Share Posted October 20, 2003 MySQL uses what are called \"GRANT TABLES\" for username/password information. Grant Tables are actually a table in a mysql database, and you\'ll have to maintain that. If I remember correctly the syntax is: GRANT * ON databasename FOR \'username\'@\'host they connect from\' IDENTIFIED BY \'password\' you can of course allow the user to connect from any host by using \'username\'@* and such. and instead of GRANT * you can use GRANT SELECT,UPDATE,INSERT etc. Hope this helps; if that isnt the right syntax atleast you know what to search for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.