Guest User

Untitled

a guest
May 19th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. 1.) I opened the terminal and typed in `su - ` to run as root.
  2. 2.) I then ran `mysql - u root`, which resulted in a lot of output and another prompt.
  3. 3.) I then typed in `UPDATE mysql.user SET Password=PASSWORD('NewPassHere')
  4. WHERE User='root';`
  5.  
  6. -bash: syntax error near unexpected token `('
  7.  
  8. bash: UPDATE: command not found...
  9.  
  10. [root@localhost ~]# /usr/bin/mysqladmin -u root password 'newpwd'
  11. /usr/bin/mysqladmin: connect to server at 'localhost' failed
  12. error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
  13. Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
  14.  
  15. [root@localhost ~]# sudo service mysqld status
  16. Redirecting to /bin/systemctl status mysqld.service
  17. mysqld.service
  18. Loaded: not-found (Reason: No such file or directory)
  19. Active: inactive (dead)
  20.  
  21. [root@localhost ~]# sudo service mysqld start
  22. Redirecting to /bin/systemctl start mysqld.service
  23. Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.
  24.  
  25. /usr/bin/mysqladmin -u root password 'new-password'
  26.  
  27. SELECT user, host FROM mysql.user WHERE user = 'root';
  28.  
  29. /usr/bin/mysqladmin -u root password 'new-password' -h127.0.0.1
  30.  
  31. [root@mail ~]# yum install mysql-server
  32.  
  33. [root@mail ~]# chkconfig mysqld on
  34. [root@mail ~]# service mysqld start
  35.  
  36. [root@mail ~]# mysql_secure_installation
  37. Enter current password for root (enter for none):
  38. OK, successfully used password, moving on...
  39. Set root password? [Y/n] y
  40. New password:
  41. Re-enter new password:
  42. Password updated successfully!
  43. Remove anonymous users? [Y/n] y
  44. ... Success!
  45. Disallow root login remotely? [Y/n] n
  46. ... skipping.
  47. Remove test database and access to it? [Y/n] y
  48. - Dropping test database...
  49. ... Success!
  50. - Removing privileges on test database...
  51. ... Success!
  52. Reload privilege tables now? [Y/n] y
  53. ... Success!
  54. Cleaning up...
  55. All done! If you've completed all of the above steps, your MySQL
  56. installation should now be secure.
  57. Thanks for using MySQL!
  58.  
  59. mysql -u root -p
  60.  
  61. use mysql
  62.  
  63. update user set authentication_string=password('NEWPASSWORD') where user='root';
  64.  
  65. flush privileges;
  66.  
  67. quit
  68.  
  69. mysql -u root
Add Comment
Please, Sign In to add comment