Topic 15 – SQL User Management and Security

Play Store Application link – SQL in 18 steps – App on Google Play

Managing users and securing a database is crucial for maintaining data integrity and preventing unauthorized access. In this blog, we will explore SQL user management and security with practical examples across different databases like MySQL and Oracle.


1. Creating and Managing Users

Every database system allows administrators to create and manage users who can access the database.

MySQL

To create a new user in MySQL:

CREATE USER 'john_doe'@'localhost' IDENTIFIED BY 'SecurePass123';

To check existing users:

SELECT User, Host FROM mysql.user;

To modify a user’s password:

ALTER USER 'john_doe'@'localhost' IDENTIFIED BY 'NewPass456';

To delete a user:

DROP USER 'john_doe'@'localhost';

Oracle

In Oracle, a user is also associated with a schema:

CREATE USER john_doe IDENTIFIED BY SecurePass123;

To modify the password:

ALTER USER john_doe IDENTIFIED BY NewPass456;

To drop a user:

DROP USER john_doe CASCADE;

(The CASCADE keyword removes all objects owned by the user.)


2. Granting and Revoking Permissions (GRANT, REVOKE)

Permissions define what actions a user can perform in a database.

Granting Privileges

MySQL

To grant privileges:

GRANT SELECT, INSERT, UPDATE ON mydatabase.* TO 'john_doe'@'localhost';

To grant all privileges:

GRANT ALL PRIVILEGES ON mydatabase.* TO 'john_doe'@'localhost';

Oracle

To grant permissions:

GRANT CREATE SESSION, CREATE TABLE TO john_doe;

To allow a user to perform SELECT operations on a specific table:

GRANT SELECT ON employees TO john_doe;

Revoking Privileges

MySQL

To revoke privileges:

REVOKE INSERT, UPDATE ON mydatabase.* FROM 'john_doe'@'localhost';

Oracle

To revoke permissions:

REVOKE CREATE TABLE FROM john_doe;


3. Roles and Privileges

Roles allow you to manage multiple users efficiently by assigning common privileges to a group.

MySQL (Starting from MySQL 8.0)

Creating a role:

CREATE ROLE data_analyst;

Granting privileges to a role:

GRANT SELECT, INSERT ON mydatabase.* TO data_analyst;

Assigning the role to a user:

GRANT data_analyst TO 'john_doe'@'localhost';

Oracle

Creating a role:

CREATE ROLE hr_manager;

Granting privileges to the role:

GRANT CREATE SESSION, SELECT ANY TABLE TO hr_manager;

Assigning the role to a user:

GRANT hr_manager TO john_doe;

To revoke a role:

REVOKE hr_manager FROM john_doe;


4. Database-Specific Variations

  • MySQL allows user management using the mysql.user system table.
  • Oracle users are tightly coupled with schemas, and the DBA_USERS view helps in managing users.
  • SQL Server uses CREATE LOGIN and CREATE USER separately to manage database-level access.

Conclusion

User management and security in SQL ensure that only authorized individuals can access and modify data. By creating users, assigning roles, and managing privileges effectively, organizations can prevent unauthorized access and ensure database security.

55 comments

  1. I’ve been playing on Craybet for about six weeks or so and thought I’d throw out what I think since I haven’t seen a ton of talk about this place around here. Registered after seeing an ad and signing up took maybe two minutes. Starting deposit was ten bucks which is about what you’d expect. They threw in a welcome bonus — 100 percent match to $500 and 50 free spins on Sweet Bonanza. Playthrough requirements were 35 times the bonus which is kinda average but not the worst I’ve seen.

    Their slots catalog is bigger than I expected. You’ll find titles from Pragmatic Play, NetEnt, plus Big Time Gaming — meaning Gates of Olympus, Gonzo’s Quest, the usual heavy hitters. Probably close to 2000 games including table games. Live casino runs on Evolution and it’s quality — tried baccarat and Crazy Time with real dealers and zero lag issues.

    Now the one thing I wasn’t thrilled about was withdrawal times. Withdrew via Skrill and it took almost two days for my first withdrawal. Once you’re verified though it dropped to like 24 hours. You can use credit cards, e-wallets like Skrill and Neteller, and crypto which covers most bases. You can look at the full bonus details over at CrayBet to see for yourself.

    Using Craybet on my phone worked better than expected. No dedicated app but the web app runs well and everything works fine. Was playing some slots on the bus and had zero performance issues.

    Customer service on Craybet is alright — there’s a chat widget that gets you a person in under five minutes most times. I contacted them about a pending withdrawal and got it fixed same day. Licensing is Curacao licensed which is standard for offshore casinos. It’s not flawless — the bonus wagering could be lower — but for what it is I keep coming back.

  2. So I’ve been playing on Craybet for roughly two months now and thought I’d throw out some thoughts since there isn’t a ton of talk about them on here. Registered after seeing an ad and registration was like a couple minutes. Starting deposit was $10 which is about what you’d expect. Got a welcome bonus — 100 percent match to $500 plus fifty free spins on Gates of Olympus. Wagering was 35x and that could be lower but not the worst I’ve seen.

    Game selection is bigger than I expected. You’ll find stuff from Pragmatic Play, Betsoft, plus Play’n GO — so like Book of Dead, Starburst, all the popular ones. Somewhere around 1500-2000 slots including table games. Live casino uses Evolution which is smooth — tried baccarat and Crazy Time with actual croupiers and it worked great.

    One thing that annoyed me a little was how long cashouts take. Tried cashing out with Visa and it took like a day and a half the first time. Second time around things sped up. Payment options include Visa, Mastercard, e-wallets like Skrill and Neteller, and BTC which is most bases. I’d look at the full bonus details on svnewtech if you’re interested.

    Mobile experience on Craybet from my iPhone worked better than expected. I didn’t find a native app but the web app runs well and all the games load fine. Was playing Book of Dead on my commute and no lag or glitches.

    Customer service on Craybet is decent — live chat and someone actually responds pretty quick when I’ve used it. Reached out once about my verification docs and they sorted it within hours. Licensing is Curacao-based from what I can tell and that’s typical of offshore casinos. Not everything is amazing — wish they had more payment options — but overall it does the job for me.

  3. So I’ve been messing around on Craybet for like a couple months and figured I’d share what I think because there’s not many posts about it around here. Signed up after seeing an ad and the whole process was like two minutes. Minimum deposit is $10 and that’s about what you’d expect. They threw in a welcome bonus — 100% up to $500 and 50 free spins on Sweet Bonanza. Wagering was 35x and that could be lower but not the worst I’ve seen.

    The game library is honestly pretty solid. You’ll find stuff from Pragmatic Play, Evolution, plus Microgaming — so like Book of Dead, Gonzo’s Quest, the usual heavy hitters. Probably close to 1500-2000 slots total if you count everything. Live dealer stuff is powered by Evolution which is smooth — played some blackjack and Crazy Time with real dealers and it worked great.

    One thing that kinda bugged me was withdrawal times. I used Bitcoin and it took almost two days for my first withdrawal. Second time around things sped up. They accept Visa, Mastercard, e-wallets like Skrill and Neteller, Bitcoin which covers most bases. I’d check out their current offers over at CrayBet to see for yourself.

    Using Craybet from my iPhone is actually smooth. I didn’t find a native app though the browser version loads fast and slots and live games work without issues. Played some slots on the bus and no lag or glitches.

    Customer service on Craybet has been alright — live chat and someone actually responds pretty quick most times. I contacted them about my verification docs and got it fixed pretty quickly. Not sure about Curacao-based from what I can tell and that’s what most US-friendly sites. Wouldn’t say it’s perfect — wish they had more payment options — but overall I keep coming back.

  4. В клинике применяются доказательные методы лечения, соответствующие международным и российским рекомендациям. Основу составляет медикаментозная детоксикация, сопровождаемая психотерапией, когнитивно-поведенческой коррекцией, а также семейной консультацией. При необходимости применяются пролонгированные препараты, облегчающие контроль над тягой к веществу.
    Изучить вопрос глубже – http://

  5. ProDentim is a distinctive oral-care formula that pairs targeted probiotics with plant-based ingredients to encourage strong teeth, comfortable gums, and reliably fresh breath.

  6. **insuleaf**

    InsuLeaf is a high-quality, naturally formulated supplement created to help maintain balanced blood glucose, support metabolic health, and boost overall vitality.

  7. **aquasculpt**

    AquaSculpt is a high-quality metabolic support supplement created to help the body utilize fat more efficiently while maintaining steady, reliable energy levels throughout the day.

  8. **native gut**

    NativeGut is a precision-crafted nutritional blend designed to nurture your dog’s digestive tract.

  9. **heroup**

    HeroUP is a premium mens wellness formula designed to support sustained energy, physical stamina, and everyday confidence.

  10. **boostaro**

    Boostaro is a purpose-built wellness formula created for men who want to strengthen vitality, confidence, and everyday performance.

  11. **prodentim**

    ProDentim is a distinctive oral-care formula that pairs targeted probiotics with plant-based ingredients to encourage strong teeth, comfortable gums, and reliably fresh breath.

  12. **nervecalm**

    NerveCalm is a high-quality nutritional supplement crafted to promote nerve wellness, ease chronic discomfort, and boost everyday vitality.

  13. Ahaa, its nice conversation on the topic of this article here at this weblog, I have read all that, so now me also commenting here.

  14. Heya i’m for the primary time here. I found this board and I find It really helpful & it helped me out much. I hope to provide one thing again and help others like you helped me.

  15. That is a really good tip particularly to those new to the blogosphere. Brief but very accurate info… Many thanks for sharing this one. A must read post!

  16. Hi there all, here every one is sharing these kinds of experience, thus it’s nice to read this website, and I used to pay a quick visit this blog all the time.

  17. You’ve made some really good points there. I checked on the internet to learn more about the issue and found most people will go along with your views on this website.

  18. I like what you guys are usually up too. Such clever work and coverage! Keep up the wonderful works guys I’ve added you guys to my own blogroll.

  19. Great work! This is the kind of information that are supposed to be shared around the net. Shame on Google for not positioning this post higher! Come on over and seek advice from my web site . Thank you =)

  20. Ahaa, its good discussion regarding this post at this place at this web site, I have read all that, so at this time me also commenting at this place.

  21. I’ll right away seize your rss as I can’t find your email subscription hyperlink or e-newsletter service. Do you have any? Please let me know so that I may just subscribe. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *