Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,294 members, 7,826,172 topics. Date: Monday, 13 May 2024 at 10:41 AM

MySql: Is It Advisable To Create Users In This Way Using Mysql? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / MySql: Is It Advisable To Create Users In This Way Using Mysql? (1155 Views)

Is It Advisable To Learn Java As My First Programming Language? / Lets Start A Real Web-deveopment Course Here Html+css+javascript+php+mysql / Is It Advisable To Start Learning Programing With C++ (2) (3) (4)

(1) (Reply) (Go Down)

MySql: Is It Advisable To Create Users In This Way Using Mysql? by logicalhumour: 8:53pm On Aug 27, 2016
Really, all my years as a programmer, I've been dealing with GUI stuffs. Pls answer this:
for example on nairaland, is this how users are created? eg
CREATE USER 'logicalhumour'@'nairaland.com' IDENTIFIED BY 'omega123ova';


Before something like
GRANT SELECT, INSERT, UPDATE ON nairaland_db.user_db TO 'logicalhumour'@'nairaland.com';


Is this how it's done?.
Thanks.
Re: MySql: Is It Advisable To Create Users In This Way Using Mysql? by bigtt76(f): 9:22pm On Aug 27, 2016
Yes it is smiley
Re: MySql: Is It Advisable To Create Users In This Way Using Mysql? by logicalhumour: 12:02am On Aug 28, 2016
bigtt76:
Yes it is smiley
Thanks... but is that how real websites do it?
Re: MySql: Is It Advisable To Create Users In This Way Using Mysql? by foldl: 11:41am On Aug 30, 2016
@logicalhumour I suspect you're trolling but I'll answer your question in the off chance that you're not.

That is how you create a user in mysql but not quite in the same sense as creating a user account for users on your site. Creating a user in this manner is similar to creating a Windows user (I.e. the type you use to login to your laptop after booting) for every user of your site. So, in reality you only need just one (or a couple for things like replication, backup etc) such mysql user.

Your website will then use this one mysql user to connect to the mysql server. In addition to having this mysql user you must create a database in mysql and explicitly grant access to that database to this user. Within this database you also must create a table in which the actual login credentials of users of your site will be stored.

To recap, use the mysql user account to connect to a specific database on your mysql server. When connected create a record in a table with username and password for your site's user.

PS: For one who claims to have 'years as a programmer' and given your username it is hard to believe that you're not just trolling with this question. However, am glad to be punked.
Re: MySql: Is It Advisable To Create Users In This Way Using Mysql? by logicalhumour: 8:18am On Sep 17, 2016
foldl:
@logicalhumour I suspect you're trolling but I'll answer your question in the off chance that you're not.

That is how you create a user in mysql but not quite in the same sense as creating a user account for users on your site. Creating a user in this manner is similar to creating a Windows user (I.e. the type you use to login to your laptop after booting) for every user of your site. So, in reality you only need just one (or a couple for things like replication, backup etc) such mysql user.

Your website will then use this one mysql user to connect to the mysql server. In addition to having this mysql user you must create a database in mysql and explicitly grant access to that database to this user. Within this database you also must create a table in which the actual login credentials of users of your site will be stored.

To recap, use the mysql user account to connect to a specific database on your mysql server. When connected create a record in a table with username and password for your site's user.

PS: For one who claims to have 'years as a programmer' and given your username it is hard to believe that you're not just trolling with this question. However, am glad to be punked.
Lol... Thanks... but how on earth do you think its real

(1) (Reply)

Welcome Party!!! / How Do I Open A Blog Spot? / How To Learn Any Programming Language Quickly

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 19
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.