How to Fix Curl Could Not Resolve Host Error in Linux
![]()
MySQL Database Recovery Tool by Stellar is designed to assist in resolving various issues that may occasionally arise while managing MySQL and MariaDB databases.
It can efficiently repair all inaccessible or corrupted database objects (tables, primary keys, views, triggers, etc.) created in the InnoDB and MyISAM MySQL database engines without altering or deleting the original databases.
MySQL versions 8.x, 6.x, 5.x, 4.x, and 3.x are compatible as of writing, and since itβs available for Windows, Ubuntu, and Red Hat-based distributions, you can easily recover your MySQL database on these systems. Otherwise, you can copy the MySQL data folder from an unsupported OS to either Windows or Linux, repair it, and move it back to the original OS.
After saving the repaired database in MySQL or MariaDB formats, this tool allows us to save it in various other file formats, such as SQL Script, CSV, HTML, and XLS, which can be crucial when repairing MySQL on a system without MySQL or MariaDB installed.
| Pros | Cons |
|---|---|
| Available for Windows, Ubuntu, and Red Hat-based distributions. | Not available for macOS. |
| Efficiently can repair the latest version of MySQL and MariaDB databases. | Itβs proprietary software. |
| Export the database file in SQL script, CSV, HTML, and XLS file formats. | Itβs premium software with a free trial given, which can only perform repairs and display the repaired database but does not apply the changes. |
| The βSave log reportβ option allows viewing and analyzing the log content later for forensic analysis. | The softwareβs license key is quite expensive compared to alternatives. |
| A user-friendly interface that allows navigation and selection of the MySQL data directory for repairing corruption and applying necessary patches. | Itβs not completely ready for Linux systems. You might need to move your MySQL data folder to Windows for repair, as the Windows version of this tool works perfectly. |
Since itβs available for both Windows and Linux (especially Ubuntu and Red Hat-based distributions), Iβll show you the steps to install it on a Linux distribution.
So, start by navigating to its product page to download Stellar Repair for MySQL, select βLinuxβ, and then click on βFree Downloadβ (you can begin with the free version and activate it with a license key later).

Youβll be redirected to the Linux download page, where you can download the package file based on your Linux distribution type. For example, clicking the download button under βFor CentOS Redhatβ will download the β.rpmβ file, while βFor Ubuntuβ will download the β.debβ file.

Once the file is downloaded, open your terminal, navigate to the β~/Downloads/β directory, and execute one of the following commands according to your Linux distribution.
# Navigating to Downloads directory
$ cd ~/Downloads/
# Installation Command for Ubuntu-based distributions
$ sudo dpkg -i ./StellarRepairforMySQL-U.deb
# Installation Command for Red Hat-based distributions
$ sudo rpm -i ./StellarRepairforMySQL.rpm
When the installation is finished, you can launch the program by searching βRepair for MySQLβ in the Activity Overview.

When launched for the first time, it prompts you to provide the current logged-in username (auto-detected) and password. Before entering the credentials, make sure the logged-in user has sudo privileges to allow the program to perform repairs without interruption.

Once logged in, you will be presented with the dashboard where you can activate the program using a license key (which is only needed when you want to apply the changes), but for demonstration purposes, you can test it without a license key.
To achieve this, stop your MySQL services and copy the MySQL data folder, typically located at β/var/lib/mysqlβ in Linux, to a safe location like your home directory for use as a backup.
$ sudo systemctl stop mysql
$ cp /var/lib/mysql $HOME/
Afterward, open the βMySQL Database Recovery Toolβ and click the βSelect Databaseβ option.

A prompt will pop up asking to select the relevant MySQL version and data folder. Since I use the latest MySQL version, I will select the βMySQL 8.xβ option and βprovide the path to the MySQL data folderβ that needs repair.

Next, you will see a list of databases detected by the program from the provided MySQL data folder path. Simply βSelect the database that needs repairβ and proceed by clicking the βRepairβ button.

Now, it will look for errors or corruption in the selected database, perform the necessary steps to recover it, and display a success message once completed.

Since the MySQL data folder that Iβve provided does not have any issues or corruption, it did not detect any errors, as shown in the log report below. However, in your case, it might be different.
When youβre done repairing, make sure to start the MySQL service.
$ sudo systemctl start mysql
This article wouldnβt be complete without including the removal steps, so in the future, if you no longer need this tool, you can easily uninstall it from your system using the default package manager via the terminal.
# Removal Command for Ubuntu-based distributions
$ sudo apt remove stellarrepairformysql
# Removal Command for Red Hat-based distributions
$ sudo dnf remove stellarrepairformysql
The Stellar MySQL Database Recovery Tool works perfectly on Windows, but I encountered difficulties using it on Linux. For instance, providing the MySQL data folder path and selecting the target database for repair resulted in an βEither incorrect path or no tables in the databaseβ error message.
At first glance, I thought it might be a database issue, but after some trial and error, I moved the data folder in Windows and repeated the same steps, which worked without issues. This suggests that the Linux version of this tool is not fully ready and requires a workaround to function properly.
Iβm still exploring this tool myself and will continue updating this article with new updates. If you have any questions or queries regarding the tool, feel free to ask them in the comment section.
Till then, peace!
The post Stellar Repair for MySQL β Product Review appeared first on Linux TLDR.
WordPress is a popular CMS for bloggers and journalists, offering a range of features, including multi-user management, allowing admins to create separate accounts for different users with varying privileges.
The rule of thumb is to hand over the username and password to the user after account creation, but if the user or admin itself forgets the own password, the only option is to reset the user or admin password from the MySQL console or by using external tools.
In this article, Iβll show you how to reset (or change) the WordPress logins using the MySQL command-line client or the βwp-cliβ command.
The first step is to log in to your server running WordPress via SSH. Then, make sure to take a backup of your WordPress database. You can either create a snapshot of your server or use the backup option if you are using a hosting provider.
Alternatively, you can use the following command to export a specific MySQL database to an SQL file format by providing the MySQL username, password, and database name.
$ sudo mysqldump -u [user] -p [db_name] > [export_the_db.sql]
Once you have taken the backup, you can reset the WordPress password by first connecting to the MySQL or MariaDB server.
$ mysql -u [user] -p
Output:

Then you need to select the WordPress database; if you forget the database name, you can use the βSHOW DATABASES;β SQL query to list all MySQL databases. Once you locate the correct database, use the following command to select it:
MySQL> use [wordpress_db]
Output:

Then, for confirmation, you can run the following command to list all WordPress users:
MySQL> select user_login from wp_users;
Output:

I have only one user account named βlinuxtldrβ, whose password I want to change. However, in your case, there could be one or more users, so note down the username and execute the following SQL query to update that user password (using the MD5 hashing algorithm):
MySQL> UPDATE `wp_users` SET `user_pass` = MD5('changeme') WHERE `user_login` = 'wordpress-user';
Output:

When you are done, quit the MySQL console using the βexitβ SQL query and return to WordPress to log in with the updated password.
WP-CLI is a fantastic command-line tool for managing WordPress that you should definitely give a try. Weβve already covered its installation and command-line usage in a separate article, so weβll skip those parts and focus on resetting the WordPress administrator password.
First, ensure you are connected to the system running WordPress, then open your terminal and navigate to the directory where the WordPress files are stored (typically, itβs β/var/www/htmlβ).
Then run the following command to list all the WordPress user accounts:
$ wp user list
Output:

Finally, select the username whose password you want to change, and pass it to the command below, along with the new password for resetting.
$ wp user update wordpress-user --user_pass=changeme
Output:

Thatβs it; you have successfully changed the WordPress password using the βwp-cliβ tool.
All the methods mentioned would work for resetting the WordPress password; you can choose one according to your preference. If you have any questions, feel free to ask them in the comments.
Till then, peace!
The post Reset the WordPress Admin Password Using CLI (via 2 Methods) appeared first on Linux TLDR.
Are you also facing the βpkg-config script could not be foundβ or βconfigure: error: pkg-config is requiredβ error while compiling your favorite program? Then just run one of the following commands based on your Linux distribution, and the problem will be resolved.
# On Debian, Ubuntu, Kali Linux, Linux Mint, Zorin OS, Pop!_OS, etc.
$ sudo apt install pkg-config
# On Red Hat, Fedora, CentOS, Rocky Linux, AlmaLinux, etc.
$ sudo dnf install pkgconfig
# On Arch Linux, Manjaro, BlackArch, Garuda, etc.
$ sudo pacman -S pkgconf
# For macOS
$ brew install pkg-config
Interested in knowing more about this package? Then, letβs start.
pkg-config is a helper tool that is used to provide the correct path of header files or libraries to the compiler option during the compilation of an application or program.Β
It often happens that the path of header files or libraries varies for different systems; instead of hard-coding them, pkg-config helps determine the proper paths to header files and code to link them to your software project.
Itβs free, open-source, and originally released for Linux and other UNIX-like systems, but later ported to Windows and macOS. The program code has been rewritten multiple times, with the first implementation by James Henstridge and the current one maintained by Tollef Fog Heen.
Letβs now see how pkg-config can help us find the correct path to pass to the compiler.
pkg-config helps during the compilation of applications by providing paths to the installed header files and libraries. To learn its usage, you must first find out the list of available packages on your system using this command:
$ pkg-config --list-all
Output:

Once you have selected the package name, you mainly use the following two options:
Letβs say you want to find the compiler option for the βpython3β package, you can run:
$ pkg-config --libs --cflags python3
Output:

In this scenario, there is only one path for each βincludeβ and βlibsβ compiler option. However, certain packages, like βgtk+-3.0β may offer multiple paths.
$ pkg-config --libs --cflags gtk+-3.0
Output:

These outputs can be used for program compilation. You can either copy-paste it or assign it to a custom environment variable. For example, exporting the output of the pkg-config command to the compiler via environment variables would look like this:
$ export COMPILER_PATHS=$(pkg-config --libs --cflags LIBRARYNAME)
Afterward, you can use this environment variable to compile your program, like below:
$ COMPILER -c MYPROGRAM ${COMPILER_PATHS}
If youβre not a programmer and arenβt involved in compilation, you might wonder why this matters. However, if you do end up involved in compiling other programs via source code, the βconfigureβ file you use to set up the environment might include pkg-config for providing paths. In that case, pkg-config must be installed on your system, or you might encounter the error mentioned in the article introduction.
I hope you understood the concept of pkg-configβwhat it is, when to use it, and why you should care. If you have further questions, feel free to ask them in the comments.
Till then, peace!
The post [Fixed] pkg-config script could not be found in Linux appeared first on Linux TLDR.
A newbie user often struggles to identify the process behind a specific listening port. Indeed, itβs not all their fault, as some listening ports are started and managed by the OS. However, they may forget the name or struggle to find the process ID of the service they manually started.
The running (or unresponsive) process must be stopped to free the occupied port and make it available for other processes. Letβs assume you are running an Apache server that uses ports 80 (for HTTP) and 443 (for HTTPS). You wonβt be able to launch an Nginx server that shares these common ports until the Apache server is stopped.
Itβs one of the many scenarios, and listening ports are often overlooked by users until a process fails to launch due to port unavailability. Hence, in this quick guide, Iβll show you how to identify and kill a process running on a specific port in Linux.
There are many ways to find and terminate processes running on a certain port. However, IT Guy, SysAdmin, or network engineers often favor using the CLI tool for this job. In such cases, you can use the βkillportβ, βfuserβ, βlsofβ, βnetstatβ, and βssβ commands as detailed in the following sections.
Killport is a fantastic CLI tool for killing a process running on a specific port by using only the port number, without needing a service name or process ID. The only inconvenience is that itβs an external tool, but you can quickly install it on your Linux system by following our installation guide.
Once you have it installed, you can quickly terminate the process running on a certain port. Letβs assume you have an Apache server running on port 80. To stop it, simply execute this command:
$ sudo killport 80
Output:

Well, ignore the last βNo such processβ messageβitβs simply the response to the last kill signal sent to the process. The key point is that the port is now available for use by any other process.
Fuser is another great tool used for identifying processes using specific files, file systems, or sockets. Despite using it to identify processes running on specific sockets (or ports), you can use it to troubleshoot issues related to file locking, process management, and system resources.
It comes preinstalled on some popular Linux distributions like Ubuntu, Fedora, and Manjaro, but if itβs not available on your system, you can install the βpsmiscβ package that contains βfuserβ and other command-line utilities.
# On Debian, Ubuntu, Kali Linux, Linux Mint, Zorin OS, Pop!_OS, etc.
$ sudo apt install psmisc
# On Red Hat, Fedora, CentOS, Rocky Linux, AlmaLinux, etc.
$ sudo dnf install psmisc
# On Arch Linux, Manjaro, BlackArch, Garuda, etc.
$ sudo pacman -S psmisc
# On OpenSUSE system
$ sudo zypper install psmisc
To find out the process running on a specific port, you can specify the port number and its TCP or UDP protocol in the βfuserβ command.
$ sudo fuser 80/tcp
The above command will return the process ID in charge of handling the specified port.

Instead of printing the running process ID, you can use the β-kβ option with the above command to terminate the process associated with that process ID.
$ sudo fuser -k 80/tcp
Output:

Once you terminate the process with this method, you may need to wait a 60-second delay before the process fully shuts down. This is implemented as a security measure to avoid potential data corruption or conflicts. If you want to immediately stop the running process, you can specify the process ID in the βsudo kill -9 <PID>β command.
Lsof is another powerful tool used to identify the process responsible for managing specific files, directories, network sockets, and other system resources on the active system. It comes pre-installed with nearly all Linux distributions, requiring no additional installation.
To identify the process name and ID associated with a specific port, use the following command, followed by the port number you wish to check:
$ sudo lsof -i :80
The above command will return the output in multiple columns, with your focus areas being solely the βCOMMANDβ and βPIDβ columns.

Once you have the process ID, you can use the βkillβ command to terminate the process.
$ sudo kill -9 36749 36751 36752
Output:

The β-9β option sends the βSIGKILLβ signal to aggressively terminate the process, while you can alternatively use the β-1β option to hang up the process (less secure) and the β-15β option to gently kill the process (default).
Netstat and ss are among the most widely used tools for SysAdmins to quickly pinpoint a process name and process ID associated with a specific port. However, netstat is considered depricated, and some major Linux distributions have removed it, requiring the installation of the βnet-toolsβ package for usage.
The ss command can be found in most Linux systems, and itβs basically an improved version of netstat. Both tools use almost identical command syntaxes, with the β-tnlpβ option being the most common to identify the listening portβs process name and process ID, where each option follows.
To find out the process name or ID of port 80, you can use either the netstat or ss command with the β-tnlpβ option, along with the grep command, to filter out the data for only the specified port number.
$ sudo netstat -tnlp | grep -i :80
$ sudo ss -tnlp | grep -i :80
Output:

Instead of specifying the port number in the grep command, you can also use the service name to identify its process ID and listening port.
$ sudo netstat -tnlp | grep -i apache
$ sudo ss -tnlp | grep -i apache
Output:

Finally, to kill the corresponding process, you can specify its process ID with the following command:
$ sudo kill -9 41005
Output:

When terminating the process using the βkill -pβ command, ensure that the service is not actively being used by any other process, as forcefully terminating it could lead to data corruption or loss.
In this article, you learned different ways to terminate a process running on a specific port that would work for almost all major Linux distributions, such as Debian, Ubuntu, Red Hat, Fedora, Arch, Manjaro, etc. Well, if you have any questions or queries, feel free to tell us in the comment section.
Till then, peace!
The post Kill a Process Running on a Specific Port in Linux (via 4 Methods) appeared first on Linux TLDR.