Error MySQL: ERROR 2002 (HY000): Can't connect to local MySQL server through socket (Ubuntu 14.04.5) The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Installing mysql causes Error 2002 errorMySQL does not start up on ubuntu 12Why it can't connect to local mysql server due ERROR 2002?After installing mysql-server, and doing $mysql, mysql won't start. Mysqld.sock missingWhy is mysql run in server-client model?While accesing mysql in Ubuntu , after entering the correct password?Cannot Use mysql from Guest Account Ubuntu 14.04MySQL partition /var/lib/mysql is full BUT it is not full 1Can't start mysql on Ubuntu 18.04.1 LTS. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)Ubuntu 18.04: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) after installing XAMPP

What are these Gizmos at Izaña Atmospheric Research Center in Spain?

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Cooking pasta in a water boiler

Can undead you have reanimated wait inside a portable hole?

Simulating Exploding Dice

Sort a list of pairs representing an acyclic, partial automorphism

Python - Fishing Simulator

Match Roman Numerals

Finding the path in a graph from A to B then back to A with a minimum of shared edges

How does ice melt when immersed in water?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Semisimplicity of the category of coherent sheaves?

How is simplicity better than precision and clarity in prose?

What's the point in a preamp?

Why did all the guest students take carriages to the Yule Ball?

In horse breeding, what is the female equivalent of putting a horse out "to stud"?

What do you call a plan that's an alternative plan in case your initial plan fails?

How can I define good in a religion that claims no moral authority?

How to copy the contents of all files with a certain name into a new file?

What information about me do stores get via my credit card?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

system() function string length limit

Working through the single responsibility principle (SRP) in Python when calls are expensive

Wolves and sheep



Error MySQL: ERROR 2002 (HY000): Can't connect to local MySQL server through socket (Ubuntu 14.04.5)



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Installing mysql causes Error 2002 errorMySQL does not start up on ubuntu 12Why it can't connect to local mysql server due ERROR 2002?After installing mysql-server, and doing $mysql, mysql won't start. Mysqld.sock missingWhy is mysql run in server-client model?While accesing mysql in Ubuntu , after entering the correct password?Cannot Use mysql from Guest Account Ubuntu 14.04MySQL partition /var/lib/mysql is full BUT it is not full 1Can't start mysql on Ubuntu 18.04.1 LTS. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)Ubuntu 18.04: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) after installing XAMPP



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

service mysql status
mysql stop/waiting

service mysql restart
stop: Unknown instance:
start: Job failed to start

find / -name mysql.sock
/var/lib/mysql/mysql.sock


However, I cannot find the file mysql.sock in my server. I don't know how to deal with this problem. Is there any information else I can provide to help me get assistance?

I need your help.










share|improve this question






























    0















    mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket
    '/var/lib/mysql/mysql.sock' (2)

    service mysql status
    mysql stop/waiting

    service mysql restart
    stop: Unknown instance:
    start: Job failed to start

    find / -name mysql.sock
    /var/lib/mysql/mysql.sock


    However, I cannot find the file mysql.sock in my server. I don't know how to deal with this problem. Is there any information else I can provide to help me get assistance?

    I need your help.










    share|improve this question


























      0












      0








      0








      mysql
      ERROR 2002 (HY000): Can't connect to local MySQL server through socket
      '/var/lib/mysql/mysql.sock' (2)

      service mysql status
      mysql stop/waiting

      service mysql restart
      stop: Unknown instance:
      start: Job failed to start

      find / -name mysql.sock
      /var/lib/mysql/mysql.sock


      However, I cannot find the file mysql.sock in my server. I don't know how to deal with this problem. Is there any information else I can provide to help me get assistance?

      I need your help.










      share|improve this question
















      mysql
      ERROR 2002 (HY000): Can't connect to local MySQL server through socket
      '/var/lib/mysql/mysql.sock' (2)

      service mysql status
      mysql stop/waiting

      service mysql restart
      stop: Unknown instance:
      start: Job failed to start

      find / -name mysql.sock
      /var/lib/mysql/mysql.sock


      However, I cannot find the file mysql.sock in my server. I don't know how to deal with this problem. Is there any information else I can provide to help me get assistance?

      I need your help.







      14.04 server mysql






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 19 '18 at 6:17









      Filbuntu

      2,989144874




      2,989144874










      asked Jan 19 '18 at 1:54









      fordyyfordyy

      112




      112




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Seems that you've installed mysql-client and not mysql-server. Or may the MySQL server service has not been started.



          To install MySQL server, follow these steps (Or just to start mysql service, jump directly to step 3):



          1. Install the MySQL server by using the Ubuntu package manager: sudo apt-get update sudo apt-get install mysql-server. The installer installs MySQL and all dependencies.

          2. After the installation process is complete, run the following command to set up MySQL: /usr/bin/mysql_secure_installation. The secure installer goes through the process of setting up MySQL including creating a root user password. It will prompt you for some security options, including removing remote access to the root user and setting the root password.

          3. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          4. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          5. To ensure that the database server launches after a reboot, run the following command: sudo /usr/sbin/update-rc.d mysql defaults.

          Start the MySQL Shell:



          1. At the command prompt, run the following command to launch the the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p.


          2. When you’re prompted for a password, enter the one you set at install time or, if you haven’t set one, press Enter to submit no password.


          Hope this helps you. If not, visit https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ or comment below. Thanks!






          share|improve this answer























          • @fordyy You can accept my answer if this helped you!

            – V. Ag.
            Jan 19 '18 at 3:39












          • run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

            – fordyy
            Jan 19 '18 at 3:43











          • @fordyy Have you tried to install mysql-server?

            – V. Ag.
            Jan 19 '18 at 3:44











          • root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

            – fordyy
            Jan 19 '18 at 3:48











          • @fordyy Try uninstalling and installing mysql-server again.

            – V. Ag.
            Jan 19 '18 at 3:52












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f997531%2ferror-mysql-error-2002-hy000-cant-connect-to-local-mysql-server-through-soc%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Seems that you've installed mysql-client and not mysql-server. Or may the MySQL server service has not been started.



          To install MySQL server, follow these steps (Or just to start mysql service, jump directly to step 3):



          1. Install the MySQL server by using the Ubuntu package manager: sudo apt-get update sudo apt-get install mysql-server. The installer installs MySQL and all dependencies.

          2. After the installation process is complete, run the following command to set up MySQL: /usr/bin/mysql_secure_installation. The secure installer goes through the process of setting up MySQL including creating a root user password. It will prompt you for some security options, including removing remote access to the root user and setting the root password.

          3. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          4. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          5. To ensure that the database server launches after a reboot, run the following command: sudo /usr/sbin/update-rc.d mysql defaults.

          Start the MySQL Shell:



          1. At the command prompt, run the following command to launch the the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p.


          2. When you’re prompted for a password, enter the one you set at install time or, if you haven’t set one, press Enter to submit no password.


          Hope this helps you. If not, visit https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ or comment below. Thanks!






          share|improve this answer























          • @fordyy You can accept my answer if this helped you!

            – V. Ag.
            Jan 19 '18 at 3:39












          • run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

            – fordyy
            Jan 19 '18 at 3:43











          • @fordyy Have you tried to install mysql-server?

            – V. Ag.
            Jan 19 '18 at 3:44











          • root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

            – fordyy
            Jan 19 '18 at 3:48











          • @fordyy Try uninstalling and installing mysql-server again.

            – V. Ag.
            Jan 19 '18 at 3:52
















          0














          Seems that you've installed mysql-client and not mysql-server. Or may the MySQL server service has not been started.



          To install MySQL server, follow these steps (Or just to start mysql service, jump directly to step 3):



          1. Install the MySQL server by using the Ubuntu package manager: sudo apt-get update sudo apt-get install mysql-server. The installer installs MySQL and all dependencies.

          2. After the installation process is complete, run the following command to set up MySQL: /usr/bin/mysql_secure_installation. The secure installer goes through the process of setting up MySQL including creating a root user password. It will prompt you for some security options, including removing remote access to the root user and setting the root password.

          3. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          4. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          5. To ensure that the database server launches after a reboot, run the following command: sudo /usr/sbin/update-rc.d mysql defaults.

          Start the MySQL Shell:



          1. At the command prompt, run the following command to launch the the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p.


          2. When you’re prompted for a password, enter the one you set at install time or, if you haven’t set one, press Enter to submit no password.


          Hope this helps you. If not, visit https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ or comment below. Thanks!






          share|improve this answer























          • @fordyy You can accept my answer if this helped you!

            – V. Ag.
            Jan 19 '18 at 3:39












          • run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

            – fordyy
            Jan 19 '18 at 3:43











          • @fordyy Have you tried to install mysql-server?

            – V. Ag.
            Jan 19 '18 at 3:44











          • root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

            – fordyy
            Jan 19 '18 at 3:48











          • @fordyy Try uninstalling and installing mysql-server again.

            – V. Ag.
            Jan 19 '18 at 3:52














          0












          0








          0







          Seems that you've installed mysql-client and not mysql-server. Or may the MySQL server service has not been started.



          To install MySQL server, follow these steps (Or just to start mysql service, jump directly to step 3):



          1. Install the MySQL server by using the Ubuntu package manager: sudo apt-get update sudo apt-get install mysql-server. The installer installs MySQL and all dependencies.

          2. After the installation process is complete, run the following command to set up MySQL: /usr/bin/mysql_secure_installation. The secure installer goes through the process of setting up MySQL including creating a root user password. It will prompt you for some security options, including removing remote access to the root user and setting the root password.

          3. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          4. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          5. To ensure that the database server launches after a reboot, run the following command: sudo /usr/sbin/update-rc.d mysql defaults.

          Start the MySQL Shell:



          1. At the command prompt, run the following command to launch the the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p.


          2. When you’re prompted for a password, enter the one you set at install time or, if you haven’t set one, press Enter to submit no password.


          Hope this helps you. If not, visit https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ or comment below. Thanks!






          share|improve this answer













          Seems that you've installed mysql-client and not mysql-server. Or may the MySQL server service has not been started.



          To install MySQL server, follow these steps (Or just to start mysql service, jump directly to step 3):



          1. Install the MySQL server by using the Ubuntu package manager: sudo apt-get update sudo apt-get install mysql-server. The installer installs MySQL and all dependencies.

          2. After the installation process is complete, run the following command to set up MySQL: /usr/bin/mysql_secure_installation. The secure installer goes through the process of setting up MySQL including creating a root user password. It will prompt you for some security options, including removing remote access to the root user and setting the root password.

          3. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          4. After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running: sudo service mysql start.

          5. To ensure that the database server launches after a reboot, run the following command: sudo /usr/sbin/update-rc.d mysql defaults.

          Start the MySQL Shell:



          1. At the command prompt, run the following command to launch the the mysql shell and enter it as the root user: /usr/bin/mysql -u root -p.


          2. When you’re prompted for a password, enter the one you set at install time or, if you haven’t set one, press Enter to submit no password.


          Hope this helps you. If not, visit https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/ or comment below. Thanks!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 19 '18 at 3:28









          V. Ag.V. Ag.

          537415




          537415












          • @fordyy You can accept my answer if this helped you!

            – V. Ag.
            Jan 19 '18 at 3:39












          • run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

            – fordyy
            Jan 19 '18 at 3:43











          • @fordyy Have you tried to install mysql-server?

            – V. Ag.
            Jan 19 '18 at 3:44











          • root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

            – fordyy
            Jan 19 '18 at 3:48











          • @fordyy Try uninstalling and installing mysql-server again.

            – V. Ag.
            Jan 19 '18 at 3:52


















          • @fordyy You can accept my answer if this helped you!

            – V. Ag.
            Jan 19 '18 at 3:39












          • run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

            – fordyy
            Jan 19 '18 at 3:43











          • @fordyy Have you tried to install mysql-server?

            – V. Ag.
            Jan 19 '18 at 3:44











          • root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

            – fordyy
            Jan 19 '18 at 3:48











          • @fordyy Try uninstalling and installing mysql-server again.

            – V. Ag.
            Jan 19 '18 at 3:52

















          @fordyy You can accept my answer if this helped you!

          – V. Ag.
          Jan 19 '18 at 3:39






          @fordyy You can accept my answer if this helped you!

          – V. Ag.
          Jan 19 '18 at 3:39














          run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

          – fordyy
          Jan 19 '18 at 3:43





          run<code> /usr/bin/mysql_secure_installation<code> , the output<code> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)<code>;run<code> sudo service mysql start<code>, the output<code> start: Job failed to start<code>

          – fordyy
          Jan 19 '18 at 3:43













          @fordyy Have you tried to install mysql-server?

          – V. Ag.
          Jan 19 '18 at 3:44





          @fordyy Have you tried to install mysql-server?

          – V. Ag.
          Jan 19 '18 at 3:44













          root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

          – fordyy
          Jan 19 '18 at 3:48





          root@ubuntu:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done mysql-server is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

          – fordyy
          Jan 19 '18 at 3:48













          @fordyy Try uninstalling and installing mysql-server again.

          – V. Ag.
          Jan 19 '18 at 3:52






          @fordyy Try uninstalling and installing mysql-server again.

          – V. Ag.
          Jan 19 '18 at 3:52


















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f997531%2ferror-mysql-error-2002-hy000-cant-connect-to-local-mysql-server-through-soc%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Tamil (spriik) Luke uk diar | Nawigatjuun

          Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

          Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?