<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90463#M31769</link>
    <description>&lt;P&gt;After install mysql as per this &lt;A title="cloudera guide" href="https://www.cloudera.com/documentation/enterprise/latest/topics/cm_ig_mysql.html#cmig_topic_5_5" target="_self"&gt;cloudera guide&lt;/A&gt;&amp;nbsp;, which includes changing the "/etc/mysql/my.cnf" to the one they recommend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when I try :&lt;/P&gt;&lt;PRE&gt;sudo mysql -u root -p&lt;/PRE&gt;&lt;P&gt;I get&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)&lt;/PRE&gt;&lt;P&gt;I need to do it as follows to be able to connect to mysql:&lt;/P&gt;&lt;PRE&gt;mysql -u root -p -h 127.0.0.1&lt;/PRE&gt;&lt;P&gt;by the way I have tried the following to solve it but with no luck .... same error&lt;/P&gt;&lt;PRE&gt;sudo mkdir -p /var/run/mysqld/

sudo touch /var/run/mysqld/mysqld.pid

sudo touch /var/run/mysqld/mysqld.sock

sudo chown mysql:mysql -R /var/run/mysqld

sudo service mysql restart&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Sep 2022 14:23:29 GMT</pubDate>
    <dc:creator>anis447</dc:creator>
    <dc:date>2022-09-16T14:23:29Z</dc:date>
    <item>
      <title>Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90463#M31769</link>
      <description>&lt;P&gt;After install mysql as per this &lt;A title="cloudera guide" href="https://www.cloudera.com/documentation/enterprise/latest/topics/cm_ig_mysql.html#cmig_topic_5_5" target="_self"&gt;cloudera guide&lt;/A&gt;&amp;nbsp;, which includes changing the "/etc/mysql/my.cnf" to the one they recommend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when I try :&lt;/P&gt;&lt;PRE&gt;sudo mysql -u root -p&lt;/PRE&gt;&lt;P&gt;I get&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)&lt;/PRE&gt;&lt;P&gt;I need to do it as follows to be able to connect to mysql:&lt;/P&gt;&lt;PRE&gt;mysql -u root -p -h 127.0.0.1&lt;/PRE&gt;&lt;P&gt;by the way I have tried the following to solve it but with no luck .... same error&lt;/P&gt;&lt;PRE&gt;sudo mkdir -p /var/run/mysqld/

sudo touch /var/run/mysqld/mysqld.pid

sudo touch /var/run/mysqld/mysqld.sock

sudo chown mysql:mysql -R /var/run/mysqld

sudo service mysql restart&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:23:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90463#M31769</guid>
      <dc:creator>anis447</dc:creator>
      <dc:date>2022-09-16T14:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90469#M31770</link>
      <description>&lt;P&gt;Check&amp;nbsp;&lt;SPAN&gt;bind-address in my.cnf config file, is it set to 127.0.0.1?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 14:25:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90469#M31770</guid>
      <dc:creator>gzigldrum</dc:creator>
      <dc:date>2019-05-15T14:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90485#M31771</link>
      <description>First I would like to note that with the default my.cnf that comes with the fresh installation of MySQL the login works fine.&lt;BR /&gt;&lt;BR /&gt;Now to answer your question, this is what I have pasted in “my.cnf” as recommended by Cloudera guide, and I cannot see any bind-address option:&lt;BR /&gt;&lt;BR /&gt;[mysqld]&lt;BR /&gt;datadir=/var/lib/mysql&lt;BR /&gt;socket=/var/lib/mysql/mysql.sock&lt;BR /&gt;transaction-isolation = READ-COMMITTED&lt;BR /&gt;# Disabling symbolic-links is recommended to prevent assorted security risks;&lt;BR /&gt;# to do so, uncomment this line:&lt;BR /&gt;symbolic-links = 0&lt;BR /&gt;&lt;BR /&gt;key_buffer_size = 32M&lt;BR /&gt;max_allowed_packet = 32M&lt;BR /&gt;thread_stack = 256K&lt;BR /&gt;thread_cache_size = 64&lt;BR /&gt;query_cache_limit = 8M&lt;BR /&gt;query_cache_size = 64M&lt;BR /&gt;query_cache_type = 1&lt;BR /&gt;&lt;BR /&gt;max_connections = 550&lt;BR /&gt;#expire_logs_days = 10&lt;BR /&gt;#max_binlog_size = 100M&lt;BR /&gt;&lt;BR /&gt;#log_bin should be on a disk with enough free space.&lt;BR /&gt;#Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your&lt;BR /&gt;#system and chown the specified folder to the mysql user.&lt;BR /&gt;log_bin=/var/lib/mysql/mysql_binary_log&lt;BR /&gt;&lt;BR /&gt;#In later versions of MySQL, if you enable the binary log and do not set&lt;BR /&gt;#a server_id, MySQL will not start. The server_id must be unique within&lt;BR /&gt;#the replicating group.&lt;BR /&gt;server_id=1&lt;BR /&gt;&lt;BR /&gt;binlog_format = mixed&lt;BR /&gt;&lt;BR /&gt;read_buffer_size = 2M&lt;BR /&gt;read_rnd_buffer_size = 16M&lt;BR /&gt;sort_buffer_size = 8M&lt;BR /&gt;join_buffer_size = 8M&lt;BR /&gt;&lt;BR /&gt;# InnoDB settings&lt;BR /&gt;innodb_file_per_table = 1&lt;BR /&gt;innodb_flush_log_at_trx_commit = 2&lt;BR /&gt;innodb_log_buffer_size = 64M&lt;BR /&gt;innodb_buffer_pool_size = 4G&lt;BR /&gt;innodb_thread_concurrency = 8&lt;BR /&gt;innodb_flush_method = O_DIRECT&lt;BR /&gt;innodb_log_file_size = 512M&lt;BR /&gt;&lt;BR /&gt;[mysqld_safe]&lt;BR /&gt;log-error=/var/log/mysqld.log&lt;BR /&gt;pid-file=/var/run/mysqld/mysqld.pid&lt;BR /&gt;&lt;BR /&gt;sql_mode=STRICT_ALL_TABLES</description>
      <pubDate>Wed, 15 May 2019 17:55:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90485#M31771</guid>
      <dc:creator>anis447</dc:creator>
      <dc:date>2019-05-15T17:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90521#M31772</link>
      <description>&lt;P&gt;I have changed this line in my.cnf:&lt;/P&gt;&lt;PRE&gt;socket=/var/lib/mysql/mysql.sock&lt;/PRE&gt;&lt;P&gt;to this&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;socket=/var/run/mysqld/mysql.sock&lt;/PRE&gt;&lt;P&gt;and that fixed it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think Cloudera has to review its installation guide ... I have faced many difficulties so far ...&lt;BR /&gt;They tell you to do A and B to get C&amp;nbsp; ... you do A and B but you don't get C!! ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 05:51:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Error-Can-t-connect-to-local-MySQL-server-through-socket-var/m-p/90521#M31772</guid>
      <dc:creator>anis447</dc:creator>
      <dc:date>2019-05-16T05:51:36Z</dc:date>
    </item>
  </channel>
</rss>

