{"id":401,"date":"2021-07-23T12:29:10","date_gmt":"2021-07-23T12:29:10","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/troubleshoot-mysql-profiles\/"},"modified":"2021-07-23T12:29:10","modified_gmt":"2021-07-23T12:29:10","slug":"troubleshoot-mysql-profiles","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/troubleshoot-mysql-profiles\/","title":{"rendered":"Troubleshoot MySQL\u00ae Profiles"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>This document describes additional steps to follow if you experience problems when you attempt to connect to your remote MySQL\u00ae server.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n<p>If you see a <em>Can\u2019t connect to local MySQL server through socket \u2018\/var\/lib\/mysql\/mysql.sock\u2019 (2) 0<\/em> error, verify whether the <code>mysqld<\/code> daemon is functional.<\/p>\n<ul>\n<li>If the daemon is functional, verify the Unix socket. To do this, run the <code>netstat -ax | grep mysql<\/code> command.<\/li>\n<li>If you have one socket and an application points to the other socket, make a symbolic link to point it to the correct socket.<\/li>\n<\/ul><\/div>\n<\/div>\n<h2 id=\"error-messages\">Error messages<\/h2>\n<p>The following describes some errors that you may encounter, their possible causes, and the solutions we recommend:<\/p>\n<h3 id=\"failed-to-connect-to-remote-server\">Failed to connect to remote server<\/h3>\n<h4 id=\"dns-error-the-server-cannot-resolve-the-hostname\">DNS error: the server cannot resolve the hostname<\/h4>\n<p>Verify your DNS configuration settings.<\/p>\n<h4 id=\"invalid-ip-address-error-the-ip-address-does-not-exist\">Invalid IP address error: the IP address does not exist<\/h4>\n<ol>\n<li>Confirm the local server\u2019s IP address network configuration. For more information, read our Installation Guide &#8211; Troubleshoot Your Installation.<\/li>\n<li>Confirm the remote MySQL server\u2019s IP address.<\/li>\n<li>Ensure that the remote MySQL server is responsive.<\/li>\n<li>Verify the local and remote server firewall configuration settings.<\/li>\n<\/ol>\n<h4 id=\"incorrect-ssh-port\">Incorrect SSH port<\/h4>\n<ol>\n<li>Confirm the SSH port on the remote MySQL server:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#75715e\"># ss -pln | grep ssh<\/span>\nLISTEN     <span style=\"color:#ae81ff\">0<\/span>      <span style=\"color:#ae81ff\">128<\/span>                      :::22                      :::*      users:<span style=\"color:#f92672\">((<\/span><span style=\"color:#e6db74\">\"sshd\"<\/span>,1163,4<span style=\"color:#f92672\">))<\/span>\nLISTEN     <span style=\"color:#ae81ff\">0<\/span>      <span style=\"color:#ae81ff\">128<\/span>                       *:22                       *:*      users:<span style=\"color:#f92672\">((<\/span><span style=\"color:#e6db74\">\"sshd\"<\/span>,1163,3<span style=\"color:#f92672\">))<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Enter the correct SSH port for the remote MySQL server. In the example, the correct port is 22.<\/li>\n<\/ol>\n<h4 id=\"invalid-ssh-credentials\">Invalid SSH credentials<\/h4>\n<p>Verify you have the correct username and password to access the remote MySQL server.<\/p>\n<h3 id=\"unable-to-connect-to-remote-mysql-host-ip-connection-failed-with-error\">Unable to connect to remote MySQL host IP, connection failed with error<\/h3>\n<h4 id=\"host-hostname-is-not-allowed-to-connect-to-this-mysql-server\">Host \u2018hostname\u2019 is not allowed to connect to this MySQL server<\/h4>\n<h5 id=\"insufficient-mysql-permissions\">Insufficient MySQL permissions<\/h5>\n<p>Grant the user superuser access.\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">7\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#75715e\"># mysql mysql<\/span>\n-snip-\nmysql&gt; CREATE USER <span style=\"color:#e6db74\">'user'<\/span>@<span style=\"color:#e6db74\">'hostname'<\/span> IDENTIFIED BY <span style=\"color:#e6db74\">'password'<\/span>;\nQuery OK, <span style=\"color:#ae81ff\">0<\/span> rows affected <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">0<\/span>.00 sec<span style=\"color:#f92672\">)<\/span>\n\nmysql&gt; GRANT ALL PRIVILEGES ON *.* TO <span style=\"color:#e6db74\">'user'<\/span>@<span style=\"color:#e6db74\">'hostname'<\/span> WITH GRANT OPTION;\nQuery OK, <span style=\"color:#ae81ff\">0<\/span> rows affected <span style=\"color:#f92672\">(<\/span><span style=\"color:#ae81ff\">0<\/span>.00 sec<span style=\"color:#f92672\">)<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<h4 id=\"lost-connection-to-mysql-server-at-handshake-waiting-for-initial-communication-packet-system-error-110\">Lost connection to MySQL server at \u2018handshake: waiting for initial communication packet\u2019, system error: 110<\/h4>\n<h5 id=\"firewall-error-the-server-cannot-access-the-specified-port-on-the-remote-mysql-server\">Firewall error. The server cannot access the specified port on the remote MySQL server.<\/h5>\n<p>Verify your firewall configuration settings. For more information, read our How to Configure Your Firewall for cPanel &#038; WHM Services documentation.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        The specific solution will depend on the configuration settings of the local server, remote server, and firewall utility.\n    <\/div>\n<\/div>\n<h4 id=\"cannot-connect-to-mysql-server-on-ip-107\">Cannot connect to MySQL server on \u2018IP\u2019 (107)<\/h4>\n<h5 id=\"mysql-is-down-on-the-remote-mysql-server\">MySQL is down on the remote MySQL server.<\/h5>\n<p>Restart MySQL on the remote MySQL server.<\/p>\n<h5 id=\"incorrect-mysql-port\">Incorrect MySQL port.<\/h5>\n<ol>\n<li>Confirm the MySQL port on the remote MySQL server:\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\"><span style=\"color:#75715e\"># ss -pln | grep mysql<\/span>\nLISTEN     <span style=\"color:#ae81ff\">0<\/span>      <span style=\"color:#ae81ff\">50<\/span>                        *:3306                     *:*      users:<span style=\"color:#f92672\">((<\/span><span style=\"color:#e6db74\">\"mysqld\"<\/span>,3308,12<span style=\"color:#f92672\">))<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<\/li>\n<li>Enter the correct MySQL port for the MySQL server. In the example, the correct port is 3306.<\/li>\n<\/ol>\n<h2 id=\"reverse-dns-entry-warning\">Reverse DNS entry warning<\/h2>\n<p>Before you set up a remote MySQL server, ensure that the remote server can resolve your local server\u2019s hostname to its IP address. To confirm this, log in to the remote server via SSH and run the following command, where <code>1.2.3.4<\/code> represents the IP address:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">host <span style=\"color:#ae81ff\">1<\/span>.2.3.4<\/code><\/pre>\n<\/div>\n<p>If you do <strong>not<\/strong> have a reverse DNS entry configured for your hostname, add an entry for your hostname to the <code>\/etc\/hosts<\/code> file on the remote server.<\/p>\n<p>For more information, read our How to Configure Reverse DNS for BIND in WHM documentation.<\/p>\n<h2 id=\"remote-mysql-root-password\">Remote MySQL <code>root<\/code> password<\/h2>\n<p>You can change the MySQL <code>root<\/code> password in WHM\u2019s <em>MySQL Root Password<\/em> interface (<em>WHM<\/em> &gt;&gt; <em>Home<\/em> &gt;&gt; <em>SQL Services<\/em> &gt;&gt; <em>MySQL Root Password<\/em>). If you use a remote MySQL server, you <strong>must<\/strong> choose whether you will change the local or the remote server\u2019s <code>root<\/code> password. By default, the system selects the remote MySQL server.<\/p>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>If you install MySQL 8.0 on a remote server from the community repository, the server will enable its own levels of password validation by default. These may conflict with cPanel &#038; WHM\u2019s password validation.<\/p>\n<ul>\n<li>If you use the <em>Automatically create a MySQL superuser via SSH.<\/em> option to set up the remote MySQL profile, the system will automatically make an adjustment for these different validation schemes.<\/li>\n<li>If you use the <em>Manually enter an existing MySQL superuser\u2019s credentials<\/em> option to set up the remote MySQL profile, you will need to perform the following changes through the MySQL command line:\n<ol>\n<li>Open the <code>\/etc\/my.cnf<\/code> file with your preferred text editor.<\/li>\n<li>Add the following lines to the file:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">validate-password.policy<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">0<\/span>\nvalidate-password.length<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">1<\/span>\nvalidate_password.special_char_count<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">0<\/span>\nvalidate_password.mixed_case_count<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">0<\/span>\nvalidate_password.number_count<span style=\"color:#f92672\">=<\/span><span style=\"color:#ae81ff\">0<\/span>\n<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul><\/div>\n<\/div>\n<h3 id=\"mysql-8-0-running-on-a-cpanel-server\">MySQL 8.0 running on a cPanel server<\/h3>\n<p>When the remote MySQL server is also a cPanel &#038; WHM server, you <strong>must<\/strong> perform additional steps:<\/p>\n<ul>\n<li>If you change the MySQL <code>root<\/code> password on the hosting server, you <strong>must<\/strong> update the remote MySQL server\u2019s <code>\/root\/.my.cnf<\/code> configuration file.<\/li>\n<li>If you change the MySQL <code>root<\/code> password on the remote MySQL server, you <strong>must<\/strong> update the MySQL profile on the hosting server, and then reactivate the profile.<\/li>\n<\/ul>\n<h3 id=\"mysql-8-0-running-on-any-other-server\">MySQL 8.0 running on any other server<\/h3>\n<p>When the remote MySQL server is running on any other server, you <strong>must<\/strong> turn off password caching. Perform the following steps to avoid an authentication error:<\/p>\n<ol>\n<li>Open the <code>\/etc\/my.cnf<\/code> with your preferred text editor.<\/li>\n<li>Change the <code>default-authentication-plugin<\/code> settings value to <code>mysql_native_password<\/code>. This will resemble the following example:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">default-authentication-plugin<span style=\"color:#f92672\">=<\/span>mysql_native_password<\/code><\/pre>\n<\/div>\n<\/li>\n<li>Log in to MySQL at the command line. Then, run the following command:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">mysql&gt; ALTER USER <span style=\"color:#e6db74\">'root'<\/span>@<span style=\"color:#e6db74\">'cpanel.server.host'<\/span> IDENTIFIED WITH mysql_native_password BY <span style=\"color:#e6db74\">'12345luggage'<\/span>;<\/code><\/pre>\n<\/div>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>Use a secure password. A secure password is <strong>not<\/strong> a dictionary word, and it contains uppercase and lowercase letters, numbers, and symbols.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<\/ol><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview This document describes additional steps to follow if you experience problems when you attempt to connect to your remote MySQL\u00ae server. Note: If you see a Can\u2019t connect to local MySQL server through socket \u2018\/var\/lib\/mysql\/mysql.sock\u2019 (2) 0 error, verify whether the mysqld daemon is functional. If the daemon is functional, verify the Unix socket. &hellip;<\/p>\n","protected":false},"author":1,"featured_media":402,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/401"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=401"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/401\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/402"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}