{"id":122,"date":"2026-05-26T16:49:28","date_gmt":"2026-05-26T16:49:28","guid":{"rendered":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/"},"modified":"2026-05-26T16:49:28","modified_gmt":"2026-05-26T16:49:28","slug":"how-to-install-mysql-on-ubuntu","status":"publish","type":"post","link":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/","title":{"rendered":"How to Install MySQL on Ubuntu (20.04, 22.04 &#038; 24.04)"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>MySQL is one of the most widely used relational database systems in the world, and Ubuntu is one of the most common Linux distributions you&#8217;ll find it running on. Whether you&#8217;re setting up a new <a href=\"https:\/\/www.hostandtech.com\/vps-ssd-servers\">VPS SSD Hosting<\/a> instance, deploying a web app, or migrating off a shared hosting plan, getting MySQL installed and secured correctly is a foundational step you don&#8217;t want to rush.<\/p>\n<p>This guide covers MySQL installation on Ubuntu 20.04 (Focal), 22.04 (Jammy), and 24.04 (Noble). The steps are mostly the same across all three, and I&#8217;ll call out version-specific differences where they matter. Ubuntu&#8217;s default repositories ship MySQL 8.0 on 20.04 and 22.04, and MySQL 8.4 on 24.04 \u2014 both are covered here.<\/p>\n<p>One thing beginners consistently run into: on Ubuntu, the MySQL root account uses socket-based authentication by default, not a password. That means <code class=\"\" data-line=\"\">mysql_secure_installation<\/code> can fail or behave unexpectedly unless you know what you&#8217;re dealing with. I&#8217;ll walk through the fix in detail.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>Ubuntu 20.04, 22.04, or 24.04 server (desktop installs work too, but these steps assume a server context)<\/li>\n<li>A user account with <code class=\"\" data-line=\"\">sudo<\/code> privileges \u2014 root login works, but using a sudo user is better practice<\/li>\n<li>SSH access to the server, or a local terminal session<\/li>\n<li>Basic familiarity with the Linux command line (running commands, editing files)<\/li>\n<li>A live internet connection on the server for package downloads<\/li>\n<\/ul>\n<h2>Step-by-Step: Installing MySQL on Ubuntu<\/h2>\n<h3>Step 1: Update the Package Index<\/h3>\n<p>Before installing anything, refresh the package list so apt knows about the latest available versions. Skipping this step is one of the most common reasons installs pull outdated packages.<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-1\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-1'><code class=\"\" data-line=\"\">sudo apt update<\/code><\/pre>\n<\/div>\n<h3>Step 2: Install MySQL Server<\/h3>\n<p>Install the <code class=\"\" data-line=\"\">mysql-server<\/code> package. This pulls in the MySQL server, client tools, and all required dependencies in one shot.<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-2\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-2'><code class=\"\" data-line=\"\">sudo apt install mysql-server -y<\/code><\/pre>\n<\/div>\n<p>The installation runs without prompting you for a root password \u2014 that&#8217;s intentional on Ubuntu. Don&#8217;t worry, you&#8217;ll set one shortly.<\/p>\n<p>\ud83d\udcdd Note: On Ubuntu 24.04, this installs MySQL 8.4. On 20.04 and 22.04, you&#8217;ll get MySQL 8.0. You can verify after install with <code class=\"\" data-line=\"\">mysql --version<\/code>.<\/p>\n<h3>Step 3: Verify MySQL Is Running<\/h3>\n<p>Once the install finishes, MySQL should start automatically. Confirm it&#8217;s active before going further.<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-3\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-3'><code class=\"\" data-line=\"\">sudo systemctl status mysql<\/code><\/pre>\n<\/div>\n<p>You want to see <code class=\"\" data-line=\"\">active (running)<\/code> in green. If it shows <code class=\"\" data-line=\"\">inactive<\/code> or <code class=\"\" data-line=\"\">failed<\/code>, start it manually:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-4\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-4'><code class=\"\" data-line=\"\">sudo systemctl start mysql\nsudo systemctl enable mysql<\/code><\/pre>\n<\/div>\n<p>The <code class=\"\" data-line=\"\">enable<\/code> command makes MySQL start automatically on reboot \u2014 something you almost certainly want on a production server.<\/p>\n<h3>Step 4: Understand the Root Auth Situation Before Proceeding<\/h3>\n<p>This is the part most guides gloss over, and it&#8217;s the source of a lot of frustration. On Ubuntu, the MySQL <code class=\"\" data-line=\"\">root<\/code> user is configured to authenticate via the <code class=\"\" data-line=\"\">auth_socket<\/code> plugin by default. That means it authenticates based on your Linux system user, not a MySQL password.<\/p>\n<p>The practical effect: you can log in as root without a password <em>if<\/em> you&#8217;re running commands as the Linux root user or with <code class=\"\" data-line=\"\">sudo<\/code>. But it also means <code class=\"\" data-line=\"\">mysql_secure_installation<\/code> may prompt you for a root password that doesn&#8217;t exist yet, get confused, and either fail silently or error out.<\/p>\n<p>To avoid that, switch root to password-based authentication first. Log into MySQL using sudo:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-5\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-5'><code class=\"\" data-line=\"\">sudo mysql<\/code><\/pre>\n<\/div>\n<p>Then run the following SQL. Replace <code class=\"\" data-line=\"\">YourStrongPassword<\/code> with an actual secure password \u2014 and don&#8217;t leave the example value in place on any real server.<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-6\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-6'><code class=\"\" data-line=\"\">ALTER USER &#039;root&#039;@&#039;localhost&#039; IDENTIFIED WITH mysql_native_password BY &#039;YourStrongPassword&#039;;\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<\/div>\n<p>\ud83d\udcdd Note: On MySQL 8.4 (Ubuntu 24.04), <code class=\"\" data-line=\"\">mysql_native_password<\/code> is disabled by default as a security measure. If you get an error about an unknown plugin, use <code class=\"\" data-line=\"\">caching_sha2_password<\/code> instead: <code class=\"\" data-line=\"\">IDENTIFIED WITH caching_sha2_password BY &#039;YourStrongPassword&#039;<\/code>. This is more secure anyway.<\/p>\n<p>\u26a0 Warning: Do not use weak or example passwords on any internet-facing server. If your VPS has a public IP \u2014 which it almost certainly does \u2014 a database with a weak root password is a serious security risk.<\/p>\n<h3>Step 5: Run the Security Script<\/h3>\n<p>Now that root has a password, run <code class=\"\" data-line=\"\">mysql_secure_installation<\/code>. This script walks you through several important hardening steps: removing anonymous users, disabling remote root login, removing the test database, and reloading privilege tables.<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-7\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-7'><code class=\"\" data-line=\"\">sudo mysql_secure_installation<\/code><\/pre>\n<\/div>\n<p>The script will ask a series of yes\/no questions. Here&#8217;s what I&#8217;d recommend for a production server:<\/p>\n<ul>\n<li><strong>Validate password component<\/strong> \u2014 Enable it. It enforces password complexity rules.<\/li>\n<li><strong>Change the root password<\/strong> \u2014 You already set one, so say no unless you want to change it again.<\/li>\n<li><strong>Remove anonymous users<\/strong> \u2014 Yes. There&#8217;s no reason to keep them.<\/li>\n<li><strong>Disallow root login remotely<\/strong> \u2014 Yes. Root should never log in over the network.<\/li>\n<li><strong>Remove test database<\/strong> \u2014 Yes. It&#8217;s a security best practice.<\/li>\n<li><strong>Reload privilege tables<\/strong> \u2014 Yes.<\/li>\n<\/ul>\n<h3>Step 6: Log In and Confirm Access<\/h3>\n<p>Test that password authentication works correctly for root:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-8\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-8'><code class=\"\" data-line=\"\">mysql -u root -p<\/code><\/pre>\n<\/div>\n<p>Enter the password you set in Step 4. You should land at the MySQL shell prompt. Run a quick sanity check:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-9\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-9'><code class=\"\" data-line=\"\">SHOW DATABASES;\nSELECT user, host, plugin FROM mysql.user;<\/code><\/pre>\n<\/div>\n<p>The <code class=\"\" data-line=\"\">plugin<\/code> column in that second query will show you how each user authenticates. Root should now show <code class=\"\" data-line=\"\">mysql_native_password<\/code> or <code class=\"\" data-line=\"\">caching_sha2_password<\/code>, not <code class=\"\" data-line=\"\">auth_socket<\/code>.<\/p>\n<h3>Step 7: Create a Dedicated Database User (Recommended)<\/h3>\n<p>Running your application as the MySQL root user is bad practice. Create a dedicated user with only the permissions it needs. Here&#8217;s an example for a web app database:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-10\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-10'><code class=\"\" data-line=\"\">CREATE DATABASE myapp_db;\nCREATE USER &#039;myapp_user&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;AnotherStrongPassword&#039;;\nGRANT ALL PRIVILEGES ON myapp_db.* TO &#039;myapp_user&#039;@&#039;localhost&#039;;\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<\/div>\n<p>Replace <code class=\"\" data-line=\"\">myapp_db<\/code>, <code class=\"\" data-line=\"\">myapp_user<\/code>, and the password with your actual values. Granting privileges only on a specific database means that if this account is ever compromised, the attacker can&#8217;t touch other databases on the same server.<\/p>\n<p>\ud83d\udcdd Note: If you&#8217;re hosting multiple sites on a single VPS \u2014 a common setup \u2014 create a separate database and user for each one. It&#8217;s a few extra minutes up front and it contains any potential damage.<\/p>\n<h2>Common Issues and Troubleshooting<\/h2>\n<h3>mysql_secure_installation Keeps Asking for a Password That Doesn&#8217;t Work<\/h3>\n<p>This is almost always the socket authentication issue described in Step 4. If you skipped that step or it didn&#8217;t apply correctly, the script can&#8217;t authenticate and just loops or fails.<\/p>\n<p>Go back and run the <code class=\"\" data-line=\"\">sudo mysql<\/code> flow from Step 4, confirm the <code class=\"\" data-line=\"\">ALTER USER<\/code> command ran without errors, and try the script again. If you&#8217;re on Ubuntu 24.04 and got a plugin error, re-run using <code class=\"\" data-line=\"\">caching_sha2_password<\/code>.<\/p>\n<h3>ERROR 1045 (28000): Access Denied for User &#8216;root&#8217;@&#8217;localhost&#8217;<\/h3>\n<p>You&#8217;re getting this when trying to log in with <code class=\"\" data-line=\"\">mysql -u root -p<\/code>. It usually means either the password is wrong, or root is still using socket auth and you&#8217;re not connecting via sudo. Try <code class=\"\" data-line=\"\">sudo mysql<\/code> first to confirm you can get in at all, then revisit Step 4 to switch the auth method.<\/p>\n<h3>Can&#8217;t Connect to Local MySQL Server Through Socket &#8216;\/var\/run\/mysqld\/mysqld.sock&#8217;<\/h3>\n<p>The socket file is missing, which means MySQL isn&#8217;t running. Check the service status with <code class=\"\" data-line=\"\">sudo systemctl status mysql<\/code> and look at the journal for the actual error:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-11\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-11'><code class=\"\" data-line=\"\">sudo journalctl -u mysql --no-pager -n 50<\/code><\/pre>\n<\/div>\n<p>Common causes are disk full (MySQL can&#8217;t write its data files), permissions issues on <code class=\"\" data-line=\"\">\/var\/lib\/mysql<\/code>, or a corrupted InnoDB tablespace from an unclean shutdown. The journal output will tell you which one.<\/p>\n<h3>MySQL Starts But Immediately Stops (Crash Loop)<\/h3>\n<p>Usually a configuration error or disk space issue. Check available disk space first:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-12\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-12'><code class=\"\" data-line=\"\">df -h<\/code><\/pre>\n<\/div>\n<p>If the disk is fine, look at the MySQL error log directly:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-13\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-13'><code class=\"\" data-line=\"\">sudo tail -n 100 \/var\/log\/mysql\/error.log<\/code><\/pre>\n<\/div>\n<p>On a VPS with limited RAM, MySQL may also be getting killed by the OOM killer. Check with <code class=\"\" data-line=\"\">dmesg | grep -i oom<\/code>. If that&#8217;s the issue, tuning <code class=\"\" data-line=\"\">\/etc\/mysql\/mysql.conf.d\/mysqld.cnf<\/code> to reduce <code class=\"\" data-line=\"\">innodb_buffer_pool_size<\/code> usually resolves it.<\/p>\n<h3>Package &#8216;mysql-server&#8217; Has No Installation Candidate<\/h3>\n<p>This means your apt sources are either outdated or misconfigured. Run <code class=\"\" data-line=\"\">sudo apt update<\/code> and try again. If you&#8217;re on a minimal Ubuntu install (common on cloud VPS images), you may need to add the universe repository:<\/p>\n<div class='ht-code-snippet'><button class='ht-code-snippet__copy' onclick='htCopyCode(\"code-block-14\")' type='button' aria-label='Copy code'><svg class='ht-copy-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z'><\/path><path d='M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z'><\/path><\/svg><svg class='ht-check-icon' viewBox='0 0 32 32' width='16' height='16' fill='currentColor'><path d='M13,24l-9-9,1.414-1.414L13,21.171,26.586,7.586,28,9Z'><\/path><\/svg><\/button><span class='ht-code-snippet__feedback'>Copied to clipboard<\/span><\/p>\n<pre class='ht-code-snippet__code' id='code-block-14'><code class=\"\" data-line=\"\">sudo add-apt-repository universe\nsudo apt update\nsudo apt install mysql-server -y<\/code><\/pre>\n<\/div>\n<h2>FAQ<\/h2>\n<div class='ht-faq-section'>\n<h2>Frequently Asked Questions<\/h2>\n<div class='ht-faq-item'>\n<h3 class='ht-faq-question'>Which version of MySQL does Ubuntu install by default?<\/h3>\n<div class='ht-faq-answer'>\n<p>Ubuntu 20.04 and 22.04 install MySQL 8.0 from the default apt repositories. Ubuntu 24.04 ships MySQL 8.4. If you need a specific version that isn&#8217;t available in the default repos, you can add the official MySQL APT repository from dev.mysql.com and choose your version from there.<\/p>\n<\/div>\n<\/div>\n<div class='ht-faq-item'>\n<h3 class='ht-faq-question'>How do I allow remote connections to MySQL?<\/h3>\n<div class='ht-faq-answer'>\n<p>By default, MySQL on Ubuntu only listens on localhost (127.0.0.1). To allow remote connections, edit \/etc\/mysql\/mysql.conf.d\/mysqld.cnf and change the bind-address to 0.0.0.0 (or a specific IP), then restart MySQL with sudo systemctl restart mysql. You&#8217;ll also need to create a MySQL user with a host value other than &#8216;localhost&#8217;, and make sure your firewall allows port 3306. Be cautious \u2014 exposing MySQL directly to the internet without additional controls is a security risk.<\/p>\n<\/div>\n<\/div>\n<div class='ht-faq-item'>\n<h3 class='ht-faq-question'>How do I change the MySQL root password on Ubuntu?<\/h3>\n<div class='ht-faq-answer'>\n<p>Log in with sudo mysql (if socket auth is still active) or mysql -u root -p, then run: ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;NewPassword&#8217;; followed by FLUSH PRIVILEGES; If you&#8217;ve forgotten the root password entirely, you&#8217;ll need to restart MySQL in skip-grant-tables mode \u2014 look up the procedure for your specific MySQL version, as the steps differ between 8.0 and 8.4.<\/p>\n<\/div>\n<\/div>\n<div class='ht-faq-item'>\n<h3 class='ht-faq-question'>Is MySQL or MariaDB better for Ubuntu?<\/h3>\n<div class='ht-faq-answer'>\n<p>For most web hosting setups, either will work. MariaDB is a drop-in MySQL alternative with some performance differences and a slightly different feature set. If you&#8217;re following specific documentation for an app (like certain WordPress configurations or a framework with MySQL-specific queries), stick with MySQL to avoid compatibility surprises. MariaDB can be installed with sudo apt install mariadb-server and follows a similar setup process.<\/p>\n<\/div>\n<\/div>\n<div class='ht-faq-item'>\n<h3 class='ht-faq-question'>Do I need to install MySQL separately if I&#039;m using managed WordPress hosting?<\/h3>\n<div class='ht-faq-answer'>\n<p>No. With Host &#038; Tech managed WordPress hosting, MySQL is pre-installed, configured, and maintained as part of the stack \u2014 you don&#8217;t touch the database server directly. MySQL installation is something you&#8217;d handle yourself on a VPS or dedicated server where you control the full environment.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Getting MySQL running on Ubuntu is usually quick, but there are a few post-install steps most guides skip \u2014 including one that will lock you out of your own database if you miss it. Here&#8217;s how to do it properly.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[59],"tags":[60,12,52,15,11],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-database","tag-linux","tag-mysql","tag-ubuntu","tag-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install MySQL on Ubuntu (20.04, 22.04 &amp; 24.04)<\/title>\n<meta name=\"description\" content=\"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install MySQL on Ubuntu (20.04, 22.04 &amp; 24.04)\" \/>\n<meta property=\"og:description\" content=\"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Host And Tech knowledge base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/stshostandtech\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-26T16:49:28+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:site\" content=\"@stshostandtech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\"},\"headline\":\"How to Install MySQL on Ubuntu (20.04, 22.04 &#038; 24.04)\",\"datePublished\":\"2026-05-26T16:49:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/\"},\"wordCount\":1560,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"keywords\":[\"database\",\"Linux\",\"MySQL\",\"Ubuntu\",\"VPS\"],\"articleSection\":[\"MySQL &amp; MariaDB\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/\",\"name\":\"How to Install MySQL on Ubuntu (20.04, 22.04 & 24.04)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\"},\"datePublished\":\"2026-05-26T16:49:28+00:00\",\"description\":\"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/mysql\\\/how-to-install-mysql-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install MySQL on Ubuntu (20.04, 22.04 &#038; 24.04)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"name\":\"Host And Tech knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#organization\",\"name\":\"Host And Tech knowledge base\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"contentUrl\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/05\\\/logo-dark.png\",\"width\":1134,\"height\":395,\"caption\":\"Host And Tech knowledge base\"},\"image\":{\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/stshostandtech\",\"https:\\\/\\\/x.com\\\/stshostandtech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/#\\\/schema\\\/person\\\/b6fa79c48ddaba71af32e395c5b017ee\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/hostandtech.com\\\/kb\"],\"url\":\"https:\\\/\\\/hostandtech.com\\\/kb\\\/author\\\/admin_fjj7qydm\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install MySQL on Ubuntu (20.04, 22.04 & 24.04)","description":"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"How to Install MySQL on Ubuntu (20.04, 22.04 & 24.04)","og_description":"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.","og_url":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/","og_site_name":"Host And Tech knowledge base","article_publisher":"https:\/\/www.facebook.com\/stshostandtech","article_published_time":"2026-05-26T16:49:28+00:00","author":"admin","twitter_card":"summary_large_image","twitter_creator":"@stshostandtech","twitter_site":"@stshostandtech","twitter_misc":{"Written by":"admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/"},"author":{"name":"admin","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee"},"headline":"How to Install MySQL on Ubuntu (20.04, 22.04 &#038; 24.04)","datePublished":"2026-05-26T16:49:28+00:00","mainEntityOfPage":{"@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/"},"wordCount":1560,"commentCount":0,"publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"keywords":["database","Linux","MySQL","Ubuntu","VPS"],"articleSection":["MySQL &amp; MariaDB"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/","url":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/","name":"How to Install MySQL on Ubuntu (20.04, 22.04 & 24.04)","isPartOf":{"@id":"https:\/\/hostandtech.com\/kb\/#website"},"datePublished":"2026-05-26T16:49:28+00:00","description":"Step-by-step guide to MySQL installation on Ubuntu 20.04, 22.04, and 24.04. Covers setup, securing the server, and common post-install errors.","breadcrumb":{"@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hostandtech.com\/kb\/mysql\/how-to-install-mysql-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostandtech.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Install MySQL on Ubuntu (20.04, 22.04 &#038; 24.04)"}]},{"@type":"WebSite","@id":"https:\/\/hostandtech.com\/kb\/#website","url":"https:\/\/hostandtech.com\/kb\/","name":"Host And Tech knowledge base","description":"","publisher":{"@id":"https:\/\/hostandtech.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostandtech.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostandtech.com\/kb\/#organization","name":"Host And Tech knowledge base","url":"https:\/\/hostandtech.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","contentUrl":"https:\/\/hostandtech.com\/kb\/wp-content\/uploads\/2026\/05\/logo-dark.png","width":1134,"height":395,"caption":"Host And Tech knowledge base"},"image":{"@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/stshostandtech","https:\/\/x.com\/stshostandtech"]},{"@type":"Person","@id":"https:\/\/hostandtech.com\/kb\/#\/schema\/person\/b6fa79c48ddaba71af32e395c5b017ee","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa1edac8bbadb442e059a5b65ad45a3b2e3ce689202373b96e3e567517ae4b39?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/hostandtech.com\/kb"],"url":"https:\/\/hostandtech.com\/kb\/author\/admin_fjj7qydm\/"}]}},"_links":{"self":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":0,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"wp:attachment":[{"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostandtech.com\/kb\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}