Change wordpress user password from CLI

If you are not able to login to wordpress admin and want to reset password

Follow below steps

Login to server as root user

Check database name in wp-config.php file

grep DB_NAME wp-config.php

mysql

use DB_NAME;

mysql> show tables;

+————————–+
| Tables_in_onlinesu_wp637 |
+————————–+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_swp_testimonial |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_termmeta |
| wp_terms |
| wp_usermeta |
| wp_users |
+————————–+
13 rows in set (0.01 sec)

select * from wp_users;

Note down the username password you want to reset

and run below command to reset username password

mysql> UPDATE wp_users SET user_pass = MD5(‘Akaomxxx’) WHERE user_login =’username’ ;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

Issues in emails after changing MX records cPanel

When user faces issues in email it due to domain MX pointing to remote server

in This case login to server and check domain entry whether in local or remote domains

grep domain.tld /etc/remotedomains

If domains name is not in /etc/remotedomains it will be in /etc/localhost

Change the domain MX record in zone file to fix this isssue

ONce MX records are changed run command /scripts/checkalldomainsmxs –yes

Now check the domain entries in grep /etc/remotedomains

The domain entry will be present in this file

Now remote emails should work fine

Reset bandwidth CWP

To reset bandwidth in CWP is tricky by changing package limits

Easier way to reset is resetting limits by below command

/scripts/cwp_api account reset_bandwidth username

The username is account username

A DNS entry for “rexxxxxxl.com” already exists

The User had removed his addon domain from cPanel.

However while adding back there was wrror coming up “A DNS entry for “rexxxxxxl.com” already exists”

T The issue is likely due to leftover DNS configurations from removed domains. Running the /scripts/cleandns script should correct the issue.

Running command /scripts/cleandns fixed the issue 🙂

WHM logging out repetedly

If you are getting logged out repetedly from WHM

Go to

Home /
Server Configuration /
Tweak Settings

From there in security section check on Cookie IP validation

By defaut its set to strict.

Enable loose option and save.

This should fix this issue

ERROR 1292 (22007): Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date’ at row 87103

We got error while altering a table in mysql

The issue was due to strict mode enabled in Mysql

You can check if mysql strict mode is checked using below command

# mysql

mysql> SELECT @@sql_mode;

If you see statement

+———————————————————————————————————————–+
| @@sql_mode |
+———————————————————————————————————————–+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+———————————————————————————————————————–+
1 row in set (0.01 sec)

To disabled it

open fie /etc/my.cnf

Add in below of file sql_mode=” “

and restart mysql

This will disable strict mode in mysql

Alter command works fine now

Error: GPG check FAILED

Getting error Error: GPG check FAILED while installing any package on alma linux 8 ?

While installing a package got an error

[root@secure ~]# yum install traceroute
Last metadata expiration check: 0:43:24 ago on Saturday 23 November 2024 10:15:46 AM EST.

Dependencies resolved.

Package Architecture Version Repository Size

Installing:
traceroute x86_64 3:2.1.0-8.el8 baseos 66 k

Transaction Summary

Install 1 Package

Total download size: 66 k
Installed size: 101 k
Is this ok [y/N]: y
Downloading Packages:

traceroute-2.1.0-8.el8.x86_64.rpm 260 kB/s | 66 kB 00:00

Total 147 kB/s | 66 kB 00:00
AlmaLinux 8 – BaseOS 3.3 MB/s | 3.4 kB 00:00
Importing GPG key 0xC21AD6EA:
Userid : “AlmaLinux packager@almalinux.org
Fingerprint: E53C F5EF 91CE B0AD 1812 ECB8 51D6 647E C21A D6EA
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Is this ok [y/N]: y
Key imported successfully
Import of key(s) didn’t help, wrong key(s)?
Public key for traceroute-2.1.0-8.el8.x86_64.rpm is not installed. Failing package is: traceroute-3:2.1.0-8.el8.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing ‘yum clean packages’.
Error: GPG check FAILED

Fixed this issue by importing new repodata from Almaliux

rpm –import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux

This fixed my issue and was able to install any package

https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/

WordPress Error : Missing a temporary folder

You may get an error while uploading images in wordpress with error

The error message said – Missing a temporary folder

The solution to this issue is Open wp-config.php in server

Search for WP_TEMP_DIR in wp-config and check the path

Usually its wp-content/Temp

Check if this folders exists using ls -al /home/username /public_html/wp-content/Temp

If folder is not present can create using mkdir -p /home/username /public_html/wp-content/Temp

change permissions and ownership chown user.user /home/username /public_html/wp-content/Temp -R

This should fix the issue for wordpress