How to Reset a Forgotten phpMyAdmin Password

Forgot your phpMyAdmin password? Follow this simple guide to reset your MySQL root or user password and regain access to phpMyAdmin on localhost or server.

Forgetting your phpMyAdmin password can be frustrating, especially when you’re in the middle of working on a critical project. Fortunately, resetting the password is a straightforward process. This guide walks you through the steps needed to reset your phpMyAdmin (MySQL/MariaDB) root password on a local or remote server.

Step-by-Step Guide to Reset phpMyAdmin Root Password

Step 1: Stop the MySQL Service

Before making any changes, stop the MySQL or MariaDB service.

sudo systemctl stop mysql

Step 2: Start MySQL in Safe Mode

Run MySQL in safe mode without password authentication.

sudo mysqld_safe --skip-grant-tables &

This allows you to log in without needing a password.

Step 3: Log in to MySQL

Now log into MySQL as the root user:

mysql -u root

You’ll be taken directly to the MySQL shell.

Step 4: Change the Root Password

Run the following commands to change the root password.

For MySQL 5.7+ or MariaDB 10.1+:

FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_new_password';

For older versions:

USE mysql;
UPDATE user SET password=PASSWORD('your_new_password') WHERE User='root';
FLUSH PRIVILEGES;

Replace 'your_new_password' with your desired password.

Step 5: Stop MySQL Safe Mode and Restart Normally

Press Ctrl+C to stop the MySQL safe mode process (if it’s running in foreground), or kill it using:

sudo killall -9 mysqld_safe
sudo killall -9 mysqld

Then start the service again:

sudo systemctl start mysql

Step 6: Test Login to phpMyAdmin

Go to http://localhost/phpmyadmin or your server’s phpMyAdmin URL and log in using:

  • Username: root
  • Password: the new password you just set

If successful, you’re good to go!

Tips for Better Security

  • Avoid using the root account for daily tasks. Create a separate user with limited privileges.
  • Use strong, unique passwords and store them securely using a password manager.
  • Regularly update MySQL/MariaDB and phpMyAdmin for security patches.

Common Issues & Fixes

Issue: Access denied for user 'root'@'localhost'
Fix: Ensure you flushed privileges and restarted the MySQL server after changing the password.

Issue: phpMyAdmin login loop
Fix: Check config.inc.php in your phpMyAdmin directory. Ensure $cfg['Servers'][$i]['auth_type'] is set to 'cookie'.

Conclusion

Resetting a forgotten phpMyAdmin password isn’t difficult when you follow the correct steps. Always remember to restart the MySQL service after resetting the password and ensure your configuration files are properly set. Keeping your credentials secure and using non-root accounts for regular usage can further enhance your database security.

SMTP Errors and Reply Codes Explained (Complete Guide)

Understand SMTP errors and reply codes like 421, 450, 550, and more. This guide explains what each code means and how to troubleshoot email delivery issues.

After execution of every request, SMTP server may return a particular message with some code. The problem is that it will generally be very cryptic, like “550 Requested action not taken: mailbox unavailable” or “421 Try again later”.

First of all: not every code is an error. Sometimes it’s just a response containing a detail about the SMTP server or an answer to a command.

Secondly: every code consist of three digits, and each conveys a particular information.

  • The first one defines whether the server has accepted the command, fulfilled an action, run into a temporary issue, encountered an error etc;
  • The second and the third one refine the description further, stating if there’s been a syntactic problem, or a connection trouble etc.

Unfortunately, different servers sometimes use these codes in a different way, making the whole thing even more complicated… Anyhow, the most critical series of error messages is the 5xx one, and especially the ones from 550 to 559. In particular, you will probably get a lot of 550 SMTP error codes – that is, a problem that concerns the recipient’s email address.

Finally, remember that it’s much easier to deal with these error codes if you choose to rely on a professional SMTP server that will help you solve any issue.

And here’s a list of the main SMTP response codes, with description and an action/guideline to solve it.

CODE

DESCRIPTION

ACTIONS

101

The server is unable to connect.

Try to change the server’s name (maybe it was spelt incorrectly) or the connection port.

111

Connection refused or inability to open an SMTP stream.

This error normally refers to a connection issue with the remote SMTP server, depending on firewalls or misspelled domains. Double-check all the configurations and in case ask your provider.

211

System status message or help reply.

It comes with more information about the server.

214

A response to the HELP command.

It contains information about your particular server, normally pointing to a FAQ page.

220

The server is ready.

It’s just a welcome message. Just read it and be happy that everything is working (so far)!

221

The server is closing its transmission channel. It can come with side messages like “Goodbye” or “Closing connection”.

The mailing session is going to end, which simply means that all messages have been processed.

250

Its typical side message is “Requested mail action okay completed”: meaning that the server has transmitted a message.

The oppsite of an error: everything has worked and your email has been delivered.

251

“User not local will forward”: the recipient’s account is not on the present server, so it will be relayed to another.

It’s a normal transfer action.

252

The server cannot verify the user, but it will try to deliver the message anyway.

The recipient’s email account is valid, but not verifiable. Normally the server relays the message to another one that will be able to check it.

354

The side message can be very cryptic (“Start mail input end <CRLF>.<CRLF>”). It’s the typical response to the DATA command.

The server has received the “From” and “To” details of the email, and is ready to get the body message.

420

“Timeout connection problem”: there have been issues during the message transfer.

This error message is produced only by GroupWise servers. Either your email has been blocked by the recipient’s firewall, or there’s a hardware problem. Check with your provider.

421

The service is unavailable due to a connection problem: it may refer to an exceeded limit of simultaneous connections, or a more general temporary problem.

The server (yours or the recipient’s) is not available at the moment, so the dispatch will be tried again later.

422

The recipient’s mailbox has exceeded its storage limit.

Best is to contact contact the user via another channel to alert him and ask to create some free room in his mailbox.

431

Not enough space on the disk, or an “out of memory” condition due to a file overload.

This error may depend on too many messages sent to a particular domain. You should try again sending smaller sets of emails instead of one big mail-out.

432

Typical side-message: “The recipient’s Exchange Server incoming mail queue has been stopped”.

It’s a Microsoft Exchange Server’s SMTP error code. You should contact it to get more information: generally it’s due to a connection problem.

441

The recipient’s server is not responding.

There’s an issue with the user’s incoming server: yours will try again to contact it.

442

The connection was dropped during the transmission.

A typical network connection problem, probably due to your router: check it immediately.

446

The maximum hop count was exceeded for the message: an internal loop has occurred.

Ask your SMTP provider to verify what has happened.

447

Your outgoing message timed out because of issues concerning the incoming server.

This happens generally when you exceeded your server’s limit of number of recipients for a message. Try to send it again segmenting the list in different parts.

449

A routing error.

Like error 432, it’s related only to Microsoft Exchange. Use other routing method.

450

“Requested action not taken – The user’s mailbox is unavailable”. The mailbox has been corrupted or placed on an offline server, or your email hasn’t been accepted for IP problems or blacklisting.

The server will retry to mail the message again, after some time. Anyway, verify that is working on a reliable IP address.

451

“Requested action aborted – Local error in processing”. Your ISP’s server or the server that got a first relay from yours has encountered a connection problem.

It’s normally a transient error due to a message overload, but it can refer also to a rejection due to a remote antispam filter. If it keeps repeating, ask your SMTP provider to check the situation. (If you’re sending a large bulk email with a free one that can be a common issue).

452

Too many emails sent or too many recipients: more in general, a server storage limit exceeded.

Again, the typical cause is a message overload. Usually the next try will succeed: in case of problems on your server it will come with a side-message like “Out of memory”.

471

An error of your mail server, often due to an issue of the local anti-spam filter.

Contact your SMTP service provider to fix the situation.

500

A syntax error: the server couldn’t recognize the command.

It may be caused by a bad interaction of the server with your firewall or antivirus. Read carefully their instructions to solve it.

501

Another syntax error, not in the command but in its parameters or arguments.

In the majority of the times it’s due to an invalid email address, but it can also be associated with connection problems (and again, an issue concerning your antivirus settings).

502

The command is not implemented.

The command has not been activated yet on your own server. Contact your provider to know more about it.

503

The server has encountered a bad sequence of commands, or it requires an authentication.

In case of “bad sequence”, the server has pulled off its commands in a wrong order, usually because of a broken connection. If an authentication is needed, you should enter your username and password.

504

A command parameter is not implemented.

Like error 501, is a syntax problem; you should ask your provider.

510/511

Bad email address.

One of the addresses in your TO, CC or BBC line doesn’t exist. Check again your recipients’ accounts and correct any possible misspelling.

512

A DNS error: the host server for the recipient’s domain name cannot be found.

Check again all your recipients’ addresses: there will likely be an error in a domain name (like mail@domain.coom instead of mail@domain.com).

513

“Address type is incorrect”: another problem concerning address misspelling. In few cases, however, it’s related to an authentication issue.

Doublecheck your recipients’ addresses and correct any mistake. If everything’s ok and the error persists, then it’s caused by a configuration issue (simply, the server needs an authentication).

523

The total size of your mailing exceeds the recipient server’s limits.

Re-send your message splitting the list in smaller subsets.

530

Normally, an authentication problem. But sometimes it’s about the recipient’s server blacklisting yours, or an invalid email address.

Configure your settings providing a username+password authentication. If the error persists, check all your recipients’ addresses and if you’ve been blacklisted.

541

The recipient address rejected your message: normally, it’s an error caused by an anti-spam filter.

Your message has been detected and labeled as spam. You must ask the recipient to whitelist you.

550

It usually defines a non-existent email address on the remote side.

Though it can be returned also by the recipient’s firewall (or when the incoming server is down), the great majority of errors 550 simply tell that the recipient email address doesn’t exist. You should contact the recipient otherwise and get the right address.

551

“User not local or invalid address – Relay denied”. Meaning, if both your address and the recipient’s are not locally hosted by the server, a relay can be interrupted.

It’s a (not very clever) strategy to prevent spamming. You should contact your ISP and ask them to allow you as a certified sender. Of course, with a professional SMTP provider you won’t ever deal with this issue.

552

“Requested mail actions aborted – Exceeded storage allocation”: simply put, the recipient’s mailbox has exceeded its limits.

Try to send a lighter message: that usually happens when you dispatch emails with big attachments, so check them first.

553

“Requested action not taken – Mailbox name invalid”. That is, there’s an incorrect email address into the recipients line.

Check all the addresses in the TO, CC and BCC field. There should be an error or a misspelling somewhere.

554

This means that the transaction has failed. It’s a permanent error and the server will not try to send the message again.

The incoming server thinks that your email is spam, or your IP has been blacklisted. Check carefully if you ended up in some spam lists, or rely on a professional SMTP service that will nullify this problem.

Fix “Can’t Upgrade Due to Low Disk Space on /boot” in Linux

Learn how to resolve the ‘low disk space on /boot’ error during Linux upgrades. Follow step-by-step solutions to free up /boot and complete your system updates.

Your /boot partition is filled with old kernels. It does that sometimes, not sure why it is never fixed. You can easily remove the old kernels if you know which packages they came in.

First check uname -a to check your current version.

Then run the following command:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'

This command will list all packages that you no longer need. I don’t like removing them automatically, I like to be in control when it comes to removing kernels. So for every package listed do the following:

sudo apt-get -y purge some-kernel-package

Intermezzo

This intermezzo describes in more detail how the commands work and tries to fix an issue with linux-libc-dev:amd64. Most users can skip this paragraph.

  • dpkg -l 'linux-*' list all packages that have a name starting with ‘linux-‘
  • sed '/^ii/!d; remove all lines that do *not* start withii`
  • uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/" find the current running kernel version
  • /'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d Remove all lines, except the ones containing the current running kernel version number
  • s/^[^ ]* [^ ]* \([^ ]*\).*/\1/ For each line list only the package name
  • /[0-9]/!d Remove lines that do not contain numbers.

To fix Frederick Nord’s issue I think the command can be amended as follows:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d;/^linux-\(headers\|image\)/!d'

It basically adds an extra filter:

  • /^linux-(headers\|image)/!d Delete all lines that do not start with linux-headers or linux-image

/Intermezzo

Where some-kernel-package can be replaced with one of the packages listed. Just beware that you don’t remove the kernel packages that are in current use (as listed by the uname -a) eg. sudo apt-get purge -y linux-headers-3.0.0-12 etc.

It can be automated further using the xargs command, but I don’t like that. It is a personal thing. However, here’s the command to do so:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

This is what my /boot looks like, one spare kernel (2.6.38-11) just in case and 3.2.0-24 being current:

$ ls -l /boot
total 59388
-rw-r--r-- 1 root root   730545 Sep 13  2011 abi-2.6.38-11-generic
-rw-r--r-- 1 root root   791023 Apr 25 13:51 abi-3.2.0-24-generic
-rw-r--r-- 1 root root   130326 Sep 13  2011 config-2.6.38-11-generic
-rw-r--r-- 1 root root   140341 Apr 25 13:51 config-3.2.0-24-generic
drwxr-xr-x 3 root root     5120 May 27 17:46 grub
-rw-r--r-- 1 root root 20883146 Oct  1  2011 initrd.img-2.6.38-11-generic
-rw-r--r-- 1 root root 22474219 May  5 09:04 initrd.img-3.2.0-24-generic
drwxr-xr-x 2 root root    12288 Apr 16  2009 lost+found
-rw-r--r-- 1 root root   176764 Nov 27 11:00 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27 11:00 memtest86+_multiboot.bin
-rw------- 1 root root  2656297 Sep 13  2011 System.map-2.6.38-11-generic
-rw------- 1 root root  2884358 Apr 25 13:51 System.map-3.2.0-24-generic
-rw------- 1 root root     1369 Sep 13  2011 vmcoreinfo-2.6.38-11-generic
-rw------- 1 root root  4526784 Sep 13  2011 vmlinuz-2.6.38-11-generic
-rw------- 1 root root  4965776 Apr 25 13:51 vmlinuz-3.2.0-24-generic

And file system usage:

$ df -h /boot
Filesystem Size Used Avail Use% Mounted
/dev/sda5  228M  63M  154M  29% /boot

 

How to Change File Upload Size in Ubuntu via php.ini

Learn how to increase the file upload limit on Ubuntu by editing the php.ini file. Follow this easy guide to update post_max_size and upload_max_filesize.

On Ubuntu server, maximal file size upload limit in php scripts is set to 2Mb as default.  There may be different filesize updated later in php.ini which is not sufficient to upload large database backup in phpMyAdmin.

In order to change that, two things are important,

  • Current upload_max_filesize value
  • Current location of php.ini file

To find current upload_max_filesize value, create a file called ‘pinfo.php’ at your webserver root folder with following content:

phpinfo();

Now, open recently created file in browser via http://localhost/pinfo.php (replace localhost with the servername if necessary) and look for the line

upload_max_filesize 2M

which will show you the actual maximum file size.

To change the upload_max_filesize value, open php.ini file from the location provided in information displayed from pinfo.php file. If php.ini file location is/etc/php5/apache2/php.ini, then open a ssh connection to your server and edit the file /etc/php5/apache2/php.ini as follows

sudo nano /etc/php5/apache2/php.ini

search for “upload_max_filesize” with Ctrl-W and change “2M” to “20M”. Save the file with Ctrl-O and exit with Ctrl-X. Restart the apache server with

sudo /etc/init.d/apache2 restart

and visit again http://localhost/info.php to check if the maximum file size was changed.

There is another way to change upload_max_filesize value for specific project or website only.

If you enabled mod_rewrite you can also put this to your .htaccess file:

php_value upload_max_filesize = 16G
php_value post_max_size = 16G

So, upload_max_filesize value in php.ini file can be changed using .htaccess for project specific and from php.ini file itself for whole server specific.

How to Display Facebook Albums and Photos on Your Website

Easily embed Facebook photo albums and images on your website using Graph API or plugins. Step-by-step guide to showcase Facebook content seamlessly.

Facebook Album Browser is a Reponsive jQuery plugin for browsing public albums and photos from any Facebook account and showcases them as a photo gallery on your website. Albums are displayed with respective cover photos. Click on the cover photo to display all the photos under the album. Click on any photo opens the lightbox with next/prev buttons to navigate.

The main purpose of this plugin is to embed and customize Facebook photo albums in your website without being limited with Facebook styling. It also allows you to use it as picker as it raises events for clicked album/photo.

Plugin is compatible for both desktop and mobile websites.

How to Use:

  1. Load Facebook Album Browser plugin right after the jQuery library as shown below.
    <link rel="stylesheet" href="src/jquery.fb.albumbrowser.css">
    <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="src/jquery.fb.albumbrowser.js"></script>

  2.  Create a container element in body of the page to display the Facebook Album Browser.
    <div class="fb-album-browser"></div>

  3. Call Facebook Album Browser in above container element and provide Facebook account to display albums as below.
    $(document).ready(function () {
    $(".fb-album-browser").FacebookAlbumBrowser({
    account: "starsportsindia"
    });
    });

  4. Use other options listed below to customize Facebook Album Browser plugin.
    // Facebook account
    account: "",

    // Facebook access token
    accessToken: "",

    // Display account information
    showAccountInfo: true,

    // Display the number of images
    showImageCount: true,

    // Skip albums which have no images
    skipEmptyAlbums: true,

    // An array of albums to be skipped
    skipAlbums: [],

    // switching on/off lightbox
    lightbox: true,

    // Allows using of plugin as an image multipicker.
    photosCheckbox: true,

    // An array of photos to be checked
    checkedPhotos: [],

  5. Use events listed below to perform specific actions on specific user action.
    // when album is selected in the browser.
    albumSelected: null,

    // when photo is selecetd in the browser.
    photoSelected: null,

    // when photo is selecetd in the browser.
    photoChecked: null,

    // when photo is checked.
    photoUnchecked: null,

  6. Every event function returns an object with following properties:
    id: image id in Facebook database
    url: large image url
    thumb: thumbnail image url
     

Download: https://github.com/dejanstojanovic/Facebook-Album-Browser