Can't connect to local MySQL serverTrouble installing MySQL from binariesCan't start mysql on Fedora...

Did Karl Marx ever use any example that involved cotton and dollars to illustrate the way capital and surplus value were generated?

How dangerous are set-size assumptions?

I am completely new to Tales from the Floating Vagabond, how do I get started?

3D Crossword, Cryptic, Statue View & Maze

How many people are necessary to maintain modern civilisation?

If I wouldn't want to read the story, is writing it still a good idea?

Should I prioritize my 401(k) over my student loans?

How would modern naval warfare have to have developed differently for battleships to still be relevant in the 21st century?

Hot coffee brewing solutions for deep woods camping

What is the legal status of travelling with methadone in your carry-on?

Why doesn't a marching band have strings?

Is this one of the engines from the 9/11 aircraft?

Wifi dongle speed is slower than advertised

Why change the size when print a object

Why do textbooks often include the solutions to odd or even numbered problems but not both?

Can we put equal sign after aggregate functions in sql?

How to get cool night-vision without lame drawbacks?

Tantum religio potuit suadere malorum – Lucretius

Apply brace expansion in "reverse order"

How risky is real estate?

Cascading Repair Costs following Blown Head Gasket on a 2004 Subaru Outback

How does metta sutra develop loving kindness

Interaction between Leyline of Anticipation and Teferi, Time Raveler

Why did pressing the joystick button spit out keypresses?



Can't connect to local MySQL server


Trouble installing MySQL from binariesCan't start mysql on Fedora 19Running `sudo /sbin/service mysqld start` causes system to crashMySQL service doesn't startmysql-server-5.5 unmet dependencies each time running apt-getMysql_connect(): Can't connect to local MySQL server through socket in LinuxError 2002 MYSQL OS X 10.11MySQL root account without password?Fun with Ubuntu 16.04 and mysqlProblem with MySQL: “Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'”






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







2















I want to run a website from my computer. I use XAMPP on a Kali Linux.



I installed MySQL server with the command: apt-get install mysql-server



After it was successfully installed, I entered the command mysql_secure_installation



It prompted me to login to MySQL, but it repeatedly gave the error



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


screenshot



I tried my password several times, with no changes just to check if I have typed it wrong the first time.



Can anyone tell me how to fix this? I am following a tutorial from this site.










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

    – Rui F Ribeiro
    Apr 3 '16 at 7:58






  • 1





    posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

    – cas
    Apr 4 '16 at 2:18











  • @roaima: Your edit broke the screenshot! (I fixed it.)

    – G-Man
    Apr 7 '16 at 3:39











  • @XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

    – G-Man
    Apr 7 '16 at 3:46


















2















I want to run a website from my computer. I use XAMPP on a Kali Linux.



I installed MySQL server with the command: apt-get install mysql-server



After it was successfully installed, I entered the command mysql_secure_installation



It prompted me to login to MySQL, but it repeatedly gave the error



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


screenshot



I tried my password several times, with no changes just to check if I have typed it wrong the first time.



Can anyone tell me how to fix this? I am following a tutorial from this site.










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 1





    I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

    – Rui F Ribeiro
    Apr 3 '16 at 7:58






  • 1





    posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

    – cas
    Apr 4 '16 at 2:18











  • @roaima: Your edit broke the screenshot! (I fixed it.)

    – G-Man
    Apr 7 '16 at 3:39











  • @XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

    – G-Man
    Apr 7 '16 at 3:46














2












2








2








I want to run a website from my computer. I use XAMPP on a Kali Linux.



I installed MySQL server with the command: apt-get install mysql-server



After it was successfully installed, I entered the command mysql_secure_installation



It prompted me to login to MySQL, but it repeatedly gave the error



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


screenshot



I tried my password several times, with no changes just to check if I have typed it wrong the first time.



Can anyone tell me how to fix this? I am following a tutorial from this site.










share|improve this question
















I want to run a website from my computer. I use XAMPP on a Kali Linux.



I installed MySQL server with the command: apt-get install mysql-server



After it was successfully installed, I entered the command mysql_secure_installation



It prompted me to login to MySQL, but it repeatedly gave the error



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


screenshot



I tried my password several times, with no changes just to check if I have typed it wrong the first time.



Can anyone tell me how to fix this? I am following a tutorial from this site.







kali-linux mysql xampp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 10 '18 at 11:07









Rui F Ribeiro

40.5k16 gold badges89 silver badges150 bronze badges




40.5k16 gold badges89 silver badges150 bronze badges










asked Apr 3 '16 at 0:19









XIIIXIII

161 silver badge2 bronze badges




161 silver badge2 bronze badges





bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1





    I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

    – Rui F Ribeiro
    Apr 3 '16 at 7:58






  • 1





    posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

    – cas
    Apr 4 '16 at 2:18











  • @roaima: Your edit broke the screenshot! (I fixed it.)

    – G-Man
    Apr 7 '16 at 3:39











  • @XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

    – G-Man
    Apr 7 '16 at 3:46














  • 1





    I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

    – Rui F Ribeiro
    Apr 3 '16 at 7:58






  • 1





    posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

    – cas
    Apr 4 '16 at 2:18











  • @roaima: Your edit broke the screenshot! (I fixed it.)

    – G-Man
    Apr 7 '16 at 3:39











  • @XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

    – G-Man
    Apr 7 '16 at 3:46








1




1





I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

– Rui F Ribeiro
Apr 3 '16 at 7:58





I think you are mixing up things. I could swear Xampp brings his own MySQL server, but then again I usually do not recommend it, as you can build you LAMP stack with native packages in Linux.

– Rui F Ribeiro
Apr 3 '16 at 7:58




1




1





posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

– cas
Apr 4 '16 at 2:18





posting a link to an externally hosted screenshot is even worse than posting a screenshot. don't do either. copy and paste the text from your console or terminal session.

– cas
Apr 4 '16 at 2:18













@roaima: Your edit broke the screenshot! (I fixed it.)

– G-Man
Apr 7 '16 at 3:39





@roaima: Your edit broke the screenshot! (I fixed it.)

– G-Man
Apr 7 '16 at 3:39













@XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

– G-Man
Apr 7 '16 at 3:46





@XIII: You say "I tried my password several times, ... just to check if I have typed it wrong the first time."  What are you saying?  Are you typing your root login password?  MySQL maintains its own passwords, independent of the operating system; when you install MySQL, it sets up a root account with a blank password.  Unless you set a MySQL root password and you aren't telling us about it, you should just be typing <Enter> for the password.  That said, I agree with digitaladdictions: the "Can't connect" error message makes it look like the server is not running.

– G-Man
Apr 7 '16 at 3:46










2 Answers
2






active

oldest

votes


















0














The error about not being able to connect to the socket suggests that the server is not running.



The following command will start the MySQL server.



service mysql start



Providing that works and you wish for MySQL to automatically start with the server use this command.



update-rc.d mysql enable






share|improve this answer
























  • i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

    – XIII
    Apr 3 '16 at 9:29













  • Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

    – digitaladdictions
    Apr 3 '16 at 9:45











  • @XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

    – G-Man
    Apr 7 '16 at 3:51











  • I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

    – Rui F Ribeiro
    Feb 10 '18 at 10:55



















0














XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.



So what can happen, depending on configurations is:




  • one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;

  • OR both are running, and you won't be able to talk with one of them;

  • OR you are talking with the wrong instance without realising it.


For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.



As recommendations for a near future:



There are several choices for a PHP framework installation, and two choices concerning this particular question:




  1. using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;

  2. installing XAMPP.


I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:




  • it is more standard (even for asking help here);

  • the file locations are more standard;

  • it is supported by the distribution;

  • it also benefits from more regular security updates of the OS;

  • on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.


IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.






share|improve this answer


























  • As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

    – Rui F Ribeiro
    Feb 10 '18 at 11:15
















Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f273934%2fcant-connect-to-local-mysql-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The error about not being able to connect to the socket suggests that the server is not running.



The following command will start the MySQL server.



service mysql start



Providing that works and you wish for MySQL to automatically start with the server use this command.



update-rc.d mysql enable






share|improve this answer
























  • i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

    – XIII
    Apr 3 '16 at 9:29













  • Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

    – digitaladdictions
    Apr 3 '16 at 9:45











  • @XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

    – G-Man
    Apr 7 '16 at 3:51











  • I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

    – Rui F Ribeiro
    Feb 10 '18 at 10:55
















0














The error about not being able to connect to the socket suggests that the server is not running.



The following command will start the MySQL server.



service mysql start



Providing that works and you wish for MySQL to automatically start with the server use this command.



update-rc.d mysql enable






share|improve this answer
























  • i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

    – XIII
    Apr 3 '16 at 9:29













  • Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

    – digitaladdictions
    Apr 3 '16 at 9:45











  • @XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

    – G-Man
    Apr 7 '16 at 3:51











  • I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

    – Rui F Ribeiro
    Feb 10 '18 at 10:55














0












0








0







The error about not being able to connect to the socket suggests that the server is not running.



The following command will start the MySQL server.



service mysql start



Providing that works and you wish for MySQL to automatically start with the server use this command.



update-rc.d mysql enable






share|improve this answer













The error about not being able to connect to the socket suggests that the server is not running.



The following command will start the MySQL server.



service mysql start



Providing that works and you wish for MySQL to automatically start with the server use this command.



update-rc.d mysql enable







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 3 '16 at 7:30









digitaladdictionsdigitaladdictions

2161 silver badge2 bronze badges




2161 silver badge2 bronze badges













  • i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

    – XIII
    Apr 3 '16 at 9:29













  • Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

    – digitaladdictions
    Apr 3 '16 at 9:45











  • @XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

    – G-Man
    Apr 7 '16 at 3:51











  • I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

    – Rui F Ribeiro
    Feb 10 '18 at 10:55



















  • i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

    – XIII
    Apr 3 '16 at 9:29













  • Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

    – digitaladdictions
    Apr 3 '16 at 9:45











  • @XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

    – G-Man
    Apr 7 '16 at 3:51











  • I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

    – Rui F Ribeiro
    Feb 10 '18 at 10:55

















i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

– XIII
Apr 3 '16 at 9:29







i try it. worked. but I type mysql_secure_installation again. It still don't get successfully. but error different. can you help me more?

– XIII
Apr 3 '16 at 9:29















Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

– digitaladdictions
Apr 3 '16 at 9:45





Does "service mysql status" show that MySQL is running? Is their a mysqld.sock file in /var/run/mysqld/? I do not know anything about Xampp. There might be some conflicts if it came with its own version of MySQL and you also installed it separately from Xampp.

– digitaladdictions
Apr 3 '16 at 9:45













@XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

– G-Man
Apr 7 '16 at 3:51





@XIII: Please don't post comments that say "error different".  Edit your question to describe what you have tried, and give the exact error message — preferably as text (instead of a screenshot).

– G-Man
Apr 7 '16 at 3:51













I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

– Rui F Ribeiro
Feb 10 '18 at 10:55





I still hold my opinion the problem is xampp bringing a copy of MySQL and the OP having two different MySQL servers installed.

– Rui F Ribeiro
Feb 10 '18 at 10:55













0














XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.



So what can happen, depending on configurations is:




  • one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;

  • OR both are running, and you won't be able to talk with one of them;

  • OR you are talking with the wrong instance without realising it.


For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.



As recommendations for a near future:



There are several choices for a PHP framework installation, and two choices concerning this particular question:




  1. using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;

  2. installing XAMPP.


I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:




  • it is more standard (even for asking help here);

  • the file locations are more standard;

  • it is supported by the distribution;

  • it also benefits from more regular security updates of the OS;

  • on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.


IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.






share|improve this answer


























  • As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

    – Rui F Ribeiro
    Feb 10 '18 at 11:15


















0














XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.



So what can happen, depending on configurations is:




  • one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;

  • OR both are running, and you won't be able to talk with one of them;

  • OR you are talking with the wrong instance without realising it.


For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.



As recommendations for a near future:



There are several choices for a PHP framework installation, and two choices concerning this particular question:




  1. using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;

  2. installing XAMPP.


I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:




  • it is more standard (even for asking help here);

  • the file locations are more standard;

  • it is supported by the distribution;

  • it also benefits from more regular security updates of the OS;

  • on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.


IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.






share|improve this answer


























  • As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

    – Rui F Ribeiro
    Feb 10 '18 at 11:15
















0












0








0







XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.



So what can happen, depending on configurations is:




  • one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;

  • OR both are running, and you won't be able to talk with one of them;

  • OR you are talking with the wrong instance without realising it.


For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.



As recommendations for a near future:



There are several choices for a PHP framework installation, and two choices concerning this particular question:




  1. using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;

  2. installing XAMPP.


I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:




  • it is more standard (even for asking help here);

  • the file locations are more standard;

  • it is supported by the distribution;

  • it also benefits from more regular security updates of the OS;

  • on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.


IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.






share|improve this answer















XAMPP brings it´s own copy of MySQL. Installing the official package only means you now have two MySQL servers instances installed.



So what can happen, depending on configurations is:




  • one of the instances of MySQL is not starting/not configured correctly/not with full setup completed;

  • OR both are running, and you won't be able to talk with one of them;

  • OR you are talking with the wrong instance without realising it.


For now, I do recommend deleting the official package and restarting the MySQL from XAMPP as a quick fix.



As recommendations for a near future:



There are several choices for a PHP framework installation, and two choices concerning this particular question:




  1. using the official distribution packages of Apache, MariaDB/MySQL, PHP and Perl;

  2. installing XAMPP.


I recommend the former approach, of using the official packages of the distribution instead of XAMPP for the following reasons:




  • it is more standard (even for asking help here);

  • the file locations are more standard;

  • it is supported by the distribution;

  • it also benefits from more regular security updates of the OS;

  • on top of that it also gives less problems when upgrading either the MySQL version or the distribution version.


IMO XAMPP is better suited for people running Windows, for people running Linux it is more difficult to maintain updated and is not standard.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 1 '18 at 13:16

























answered Feb 10 '18 at 11:02









Rui F RibeiroRui F Ribeiro

40.5k16 gold badges89 silver badges150 bronze badges




40.5k16 gold badges89 silver badges150 bronze badges













  • As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

    – Rui F Ribeiro
    Feb 10 '18 at 11:15





















  • As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

    – Rui F Ribeiro
    Feb 10 '18 at 11:15



















As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

– Rui F Ribeiro
Feb 10 '18 at 11:15







As an anecdotal tale, it did not take me long to migrate a XAMPP server I inherited for a new one using official packages. Easier than dealing with XAMPP.

– Rui F Ribeiro
Feb 10 '18 at 11:15




















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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%2funix.stackexchange.com%2fquestions%2f273934%2fcant-connect-to-local-mysql-server%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

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...