How to reset admin password wordpress from SQL.

Q: How to reset WordPress password via SQL ?

A: Login to mysql database

mysql -u wordpress -p

use db_wordprs;

MariaDB [(none)]> use db_wordprs;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [db_wordprs]> select * from wp_users;

+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
| ID | user_login | user_pass | user_nicename | user_email | user_url | user_registered | user_activation_key | user_status | display_name |
+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
| 1 | admin | $P$BeI/6SDDb5x33lthRtdqaoVuO8.TfH/ | admin | liviu@team-work.ro | | 2016-10-26 07:55:16 | | 0 | admin |
+—-+————+————————————+—————+——————+———-+———————+———————+————-+————–+
1 row in set (0.00 sec)

And now change / update password:
UPDATE wp_users SET user_pass= MD5(‘Your-Password’) WHERE ID = 1;

MariaDB [db_rezes]> UPDATE wp_users SET user_pass= MD5(‘Your-Password’) WHERE ID = 1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Enjoy, done.

Set WordPress file permissions and FS method

Metod to set file permissions and FS method in wordpress. To allow WordPress to configure wp-config.php during installation, update files during upgrades, and update the .htaccess file for pretty permalinks, give the server write permission on the files.

Change the owner of the wordpress directory and its contents to apache on Centos 7.  Keep the group as staff, a group to which your user account belongs and give write permissions to the group.

First Step.

[root@mailx work]# cd  /var/www/html
[root@mailx html]# chown -R apache.  wordpress-site2
[root@mailx html]# chmod -R g+w   wordpress-site2

Second Step.

Add this to your wp-config.php at the end file.

define(‘FS_METHOD’, ‘direct’);