MySQL - Create, Delete User Accounts and Grant Privileges (create/drop user, grant, show grants)

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • Find code and diagrams at: www.EliTheComp...
    MySQL has its own user accounts and security policies. Remember that most times “hackers” are only able to compromise a database using the privileges assigned to the compromised account.
    CREATE USER ‘user’@’localhost’ IDENTIFIED BY ‘password’; - Create user with Password
    DROP USER ‘user’@’localhost’ - Delete user
    GRANT ‘permission’ on DATABASE.TABLE to ‘user@localhost’; - Grant privileges to user account
    GRANT ALL PRIVILEGES ON . TO ‘user’@’localhost’; - Gives all permissions to ALL tables on ALL databases to user
    GRANT ALL PRIVILEGES ON . TO ‘user’@’localhost’ WITH GRANT OPTION; - “with grant option” gives ability for account to give privileges to other accounts.
    GRANT ‘permission'(column1,column2) on DATABASE.TABLE to user@localhost; - Grants privilege to columns in a table.
    show grants; - shows privilege of current user
    show grant for user; shows privilege for a specific user
    select user, host from mysql.user; - display users and hosts for MySQL Server
    REVOKE ‘privilege’ on DATABASE.TABLE FROM user@localhost;
    mysql -u username -p - Login to MySQL from Linux
    Privileges:
    ALL PRIVILEGES - grants all privileges to the MySQL user
    CREATE - allows the user to create databases and tables
    DROP - allows the user to drop databases and tables
    DELETE - allows the user to delete rows from specific MySQL table
    INSERT - allows the user to insert rows into specific MySQL table
    SELECT - allows the user to read the database
    UPDATE - allows the user to update table rows
    Full list of Privileges: dev.mysql.com/...

Komentáře • 32

  • @killer909Y
    @killer909Y Před 4 lety +8

    Taking a database class in college and the textbooks's exercises are complicated so I'm glad to have this series so I can have a better foundation. I also feel like you do a great job of explaining what real world situations you could find yourself in when interacting with databases.

  • @oscarmartinlive
    @oscarmartinlive Před 4 lety +6

    I love the way you talk.
    Your flow of knowledge is engaging.
    The entrance is dope!

  • @marinasha2949
    @marinasha2949 Před 3 lety +2

    Eli you are so good!!!
    "Good security is a by-product of good administration." (by Eli)
    That`s very refreshing.

  • @manojsaravanan3824
    @manojsaravanan3824 Před 3 lety +1

    Finally found a another great teacher on the internet!!

  • @citoldyou
    @citoldyou Před 4 lety +4

    Thank you Eli for being there and being a great teacher

  • @fupreblog5756
    @fupreblog5756 Před rokem

    The best security tip ever for a web developer using mysql

  • @rosaramirez8246
    @rosaramirez8246 Před 3 lety +2

    I love the way you explained everything. So easy to understand.
    Thank you.

  • @tonis864
    @tonis864 Před 4 lety +4

    Eli you are the best, greetings from Macedonia!!!

  • @budcostagingloginbudcostag3048

    best linux guy on youtube hands down. Knows his stuff

  • @TomicaCZ
    @TomicaCZ Před 4 lety +2

    Daaaaamn.... finally somebody who can actually do a proper informative video! Great job sir :)
    I learnt a lot, so thank you very much.
    btw your diction is awesome :D It might sound stupid, but it really helps to focus on all the information

  • @outofahat9363
    @outofahat9363 Před 2 lety

    17:24 perfect comedic timing 🤣

  • @jiayan9675
    @jiayan9675 Před rokem

    amazing lesson!clearer than our school lecturer🎉

  • @user-wk6oc4si6x
    @user-wk6oc4si6x Před 3 měsíci

    Sir Eli, Greetings from India!!!

  • @christophernolan8761
    @christophernolan8761 Před 4 lety +1

    Great video. I appreciate the best practices commentary. Also, how about showing the computer use using MySQL Workbench?

  • @joperez1980
    @joperez1980 Před 4 lety +1

    Greetings from Mexico, you're the best!!!

  • @nguye1971
    @nguye1971 Před 4 lety +2

    Great learning. Thx Eli

  • @anasofiaalves3937
    @anasofiaalves3937 Před 4 lety +2

    thank you so much for this video

  • @HowTo-nr7uk
    @HowTo-nr7uk Před 3 lety +1

    Who else thought why jason statham here?? 🤣

  • @oscarmartinlive
    @oscarmartinlive Před 4 lety +1

    I had to subscribe immediately

  • @VictorVii
    @VictorVii Před 4 lety +2

    Took some time off the channel, I need to catch up with awesome new content!

  • @marcelomafra
    @marcelomafra Před 4 lety +1

    Very good man.

  • @bebomohamed8860
    @bebomohamed8860 Před 4 lety

    thank you so much

  • @itprof7895
    @itprof7895 Před 3 lety

    Loved it

  • @shamiks4976
    @shamiks4976 Před 3 lety

    Loved it!!!

  • @gaurabroy4738
    @gaurabroy4738 Před 3 lety

    Sir, while creating user an error is coming that error creating account newuser@%: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY' password" at line 1

  • @baruthiwagikuyutv
    @baruthiwagikuyutv Před 4 lety

    good stuff

  • @uberfastross4348
    @uberfastross4348 Před 3 lety

    I have accidently deleted all the users. Now receiving an error and wont let me connect to phpmyadmin? Any help would be greatly appreciated

  • @this_rishi
    @this_rishi Před 3 lety

    grrreat!!

  • @sandeshtimalsina
    @sandeshtimalsina Před 3 lety

    DOPE

  • @tawonganhende6007
    @tawonganhende6007 Před 2 lety

    👏