Guest User

Untitled

a guest
Aug 12th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. php -v
  2. PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
  3. Copyright (c) 1997-2016 The PHP Group
  4. Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
  5. with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
  6.  
  7. sudo apt install mysql-server php-mysql
  8. Reading package lists... Done
  9. Building dependency tree
  10. Reading state information... Done
  11. php-mysql is already the newest version (1:7.0+35ubuntu6).
  12. mysql-server is already the newest version (5.7.13-0ubuntu0.16.04.2).
  13. The following packages were automatically installed and are no longer required:
  14. linux-headers-4.4.0-28 linux-headers-4.4.0-28-generic
  15. linux-image-4.4.0-28-generic linux-image-extra-4.4.0-28-generic
  16. linux-signed-image-4.4.0-28-generic linux-signed-image-4.4.0-31-generic
  17. Use 'sudo apt autoremove' to remove them.
  18. 0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded
  19.  
  20. sudo mysql_secure_installation
  21.  
  22. Securing the MySQL server deployment.
  23.  
  24. Enter password for user root:
  25. Error: Access denied for user 'root'@'localhost' (using password: YES)
  26.  
  27. gedit /etc/php/7.0/apache2/php.ini
  28.  
  29. In MySQL 5.7, the password field in mysql.user table field was removed, now the field name is authentication_string.
  30.  
  31. First choose the database:
  32. mysql> use mysql; And then show the tables:
  33. mysql> show tables; You will find the user table, and see its fields:
  34. mysql> describe user; You will realize there is no field named password, the password field is named authentication_string. So, just do this:
  35. update user set authentication_string=password('XXXX') where user='root'; As suggested by @Rui F Ribeiro, alternatively you can run:
  36. mysql> SET PASSWORD FOR 'root' = PASSWORD('new_password');
Add Comment
Please, Sign In to add comment