Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. MariaDB [(none)]> SELECT User,Host FROM mysql.user;
  2. +--------+-----------+
  3. | User | Host |
  4. +--------+-----------+
  5. | dba | % |
  6. | fcapdi | % |
  7. | root | 127.0.0.1 |
  8. | root | ::1 |
  9. | | localhost |
  10. | root | localhost |
  11. | | tester |
  12. | root | tester |
  13. +--------+-----------+
  14.  
  15. GRANT ALL ON
  16. your_database_schema_name.* to
  17. 'fcapdi'@'192.168.0.18' IDENTIFIED BY 'your_connection_password';
  18.  
  19. As an aside question under comments
  20.  
  21. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newPass123^');
  22. SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newPass123^');
  23. SET PASSWORD FOR 'root'@'etc_etc' = PASSWORD('newPass123^');
  24.  
  25. you can also do it in a single update statement but it depends on your mysql version
  26.  
  27. create user 'joe1'@'localhost' identified by 'blah';
  28. create user 'joe1'@'127.0.0.1' identified by 'afadfafsdblah2';
  29. create user 'joe1'@'%' identified by 'djdjdjjdjdd';;
  30.  
  31.  
  32. select user,host,password from mysql.user where user='joe1';
  33. +------+-----------+-------------------------------------------+
  34. | user | host | password |
  35. +------+-----------+-------------------------------------------+
  36. | joe1 | localhost | *0380BEA27363E56C37F0BFDA438F429080848051 |
  37. | joe1 | % | *7BEAF25E9BDFBDEF5A9B9E4A37023721B668FA51 |
  38. | joe1 | 127.0.0.1 | *5CD978E569B31B1558E5C1D0972E6E02516893BF |
  39. +------+-----------+-------------------------------------------+
  40.  
  41. update mysql.user set password=PASSWORD('nEW_COMMon_password762') where user='joe1';
  42. -- 3 rows updated
  43.  
  44. select user,host,password from mysql.user where user='joe1';
  45. +------+-----------+-------------------------------------------+
  46. | user | host | password |
  47. +------+-----------+-------------------------------------------+
  48. | joe1 | localhost | *A248B352CE5BF750A11AA9BA253B5F191C721D1A |
  49. | joe1 | % | *A248B352CE5BF750A11AA9BA253B5F191C721D1A |
  50. | joe1 | 127.0.0.1 | *A248B352CE5BF750A11AA9BA253B5F191C721D1A |
  51. +------+-----------+-------------------------------------------+
  52.  
  53. drop user 'joe1'@'%';
  54. drop user 'joe1'@'127.0.0.1';
  55. drop user 'joe1'@'localhost';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement