Advertisement
metalx1000

MySQL Users and Privileges

Feb 4th, 2024
1,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.40 KB | None | 0 0
  1. # Create MySQL Password
  2. # change 'newpassword' to your new password
  3. sudo mysql -uroot
  4. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';
  5. quit
  6.  
  7. mysql -uroot -p
  8.  
  9. # Create user with privileges
  10. CREATE USER 'jon'@'localhost' IDENTIFIED BY 'jonspassword';
  11. CREATE DATABASE IF NOT EXISTS jonsdb;
  12. GRANT SELECT, UPDATE, DELETE, INSERT ON jonsdb.* TO 'jon'@'localhost';
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement