Failed to Connect to MySQL at localhost:3306 with user root












5














I use Mysql Workbench to connect my database,[Hostname Port and Username are as shown in figure ,and password is right[1]



Hostname Port and Username are as shown in figure ,and password is right.When I click Test Connection ,it show as above.But if i use 3307 in place of 3306 as port,it connect sucessfully. What matter lead that and how I fix it?



I use macbook pro and I don't know check which my.cnf. I use sudo vim /usr/local/mysql/my.cnf in terminal .

And the my.cnf is as below:



[mysqld] 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


And I rewite it as below:



[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
[mysqldump]
quick


But it does not work.










share|improve this question
























  • Is your your mysql running on 3307 or 3306 port???
    – Darshan Patel
    Aug 15 '15 at 7:47






  • 1




    please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
    – ichadhr
    Aug 15 '15 at 7:47










  • @DarshanPatel yes, it is running
    – shengfu zou
    Aug 15 '15 at 7:48






  • 1




    but on which port??? check my.cnf as @ichadhr suggested
    – Darshan Patel
    Aug 15 '15 at 7:49






  • 1




    @Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
    – user207421
    Aug 15 '15 at 8:39
















5














I use Mysql Workbench to connect my database,[Hostname Port and Username are as shown in figure ,and password is right[1]



Hostname Port and Username are as shown in figure ,and password is right.When I click Test Connection ,it show as above.But if i use 3307 in place of 3306 as port,it connect sucessfully. What matter lead that and how I fix it?



I use macbook pro and I don't know check which my.cnf. I use sudo vim /usr/local/mysql/my.cnf in terminal .

And the my.cnf is as below:



[mysqld] 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


And I rewite it as below:



[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
[mysqldump]
quick


But it does not work.










share|improve this question
























  • Is your your mysql running on 3307 or 3306 port???
    – Darshan Patel
    Aug 15 '15 at 7:47






  • 1




    please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
    – ichadhr
    Aug 15 '15 at 7:47










  • @DarshanPatel yes, it is running
    – shengfu zou
    Aug 15 '15 at 7:48






  • 1




    but on which port??? check my.cnf as @ichadhr suggested
    – Darshan Patel
    Aug 15 '15 at 7:49






  • 1




    @Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
    – user207421
    Aug 15 '15 at 8:39














5












5








5


3





I use Mysql Workbench to connect my database,[Hostname Port and Username are as shown in figure ,and password is right[1]



Hostname Port and Username are as shown in figure ,and password is right.When I click Test Connection ,it show as above.But if i use 3307 in place of 3306 as port,it connect sucessfully. What matter lead that and how I fix it?



I use macbook pro and I don't know check which my.cnf. I use sudo vim /usr/local/mysql/my.cnf in terminal .

And the my.cnf is as below:



[mysqld] 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


And I rewite it as below:



[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
[mysqldump]
quick


But it does not work.










share|improve this question















I use Mysql Workbench to connect my database,[Hostname Port and Username are as shown in figure ,and password is right[1]



Hostname Port and Username are as shown in figure ,and password is right.When I click Test Connection ,it show as above.But if i use 3307 in place of 3306 as port,it connect sucessfully. What matter lead that and how I fix it?



I use macbook pro and I don't know check which my.cnf. I use sudo vim /usr/local/mysql/my.cnf in terminal .

And the my.cnf is as below:



[mysqld] 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


And I rewite it as below:



[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=8M
[mysqldump]
quick


But it does not work.







mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 15 '15 at 8:33







shengfu zou

















asked Aug 15 '15 at 7:36









shengfu zoushengfu zou

1211211




1211211












  • Is your your mysql running on 3307 or 3306 port???
    – Darshan Patel
    Aug 15 '15 at 7:47






  • 1




    please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
    – ichadhr
    Aug 15 '15 at 7:47










  • @DarshanPatel yes, it is running
    – shengfu zou
    Aug 15 '15 at 7:48






  • 1




    but on which port??? check my.cnf as @ichadhr suggested
    – Darshan Patel
    Aug 15 '15 at 7:49






  • 1




    @Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
    – user207421
    Aug 15 '15 at 8:39


















  • Is your your mysql running on 3307 or 3306 port???
    – Darshan Patel
    Aug 15 '15 at 7:47






  • 1




    please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
    – ichadhr
    Aug 15 '15 at 7:47










  • @DarshanPatel yes, it is running
    – shengfu zou
    Aug 15 '15 at 7:48






  • 1




    but on which port??? check my.cnf as @ichadhr suggested
    – Darshan Patel
    Aug 15 '15 at 7:49






  • 1




    @Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
    – user207421
    Aug 15 '15 at 8:39
















Is your your mysql running on 3307 or 3306 port???
– Darshan Patel
Aug 15 '15 at 7:47




Is your your mysql running on 3307 or 3306 port???
– Darshan Patel
Aug 15 '15 at 7:47




1




1




please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
– ichadhr
Aug 15 '15 at 7:47




please check your mysql configuration my.cnf the port should be port=3306 https://dev.mysql.com/
– ichadhr
Aug 15 '15 at 7:47












@DarshanPatel yes, it is running
– shengfu zou
Aug 15 '15 at 7:48




@DarshanPatel yes, it is running
– shengfu zou
Aug 15 '15 at 7:48




1




1




but on which port??? check my.cnf as @ichadhr suggested
– Darshan Patel
Aug 15 '15 at 7:49




but on which port??? check my.cnf as @ichadhr suggested
– Darshan Patel
Aug 15 '15 at 7:49




1




1




@Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
– user207421
Aug 15 '15 at 8:39




@Sajad You must be kidding. That is the standard port for an HTTP server. This is a database.
– user207421
Aug 15 '15 at 8:39












6 Answers
6






active

oldest

votes


















3














Steps:



1 - Right click on your task bar -->Start Task Manager



2 - Click on Services button (at bottom).



3 - Search for MYSQL57



4 - Right Click on MYSQL57 --> Start



Now again start your mysql-cmd-prompt or MYSQL WorkBench






share|improve this answer





























    2














    Open System Preference > MySQL > Initialize Database > Use Legacy Password Encription






    share|improve this answer





























      1














      Try to execute below command in your terminal :



      mysql -h localhost -P 3306 -u root -p


      If you successfully connect to your database, then same thing has to happen with Mysql Workbench.



      If you are unable to connect then I think 3306 port is acquired by another process.



      Find which process running on 3306 port. If required, give admin privileges using sudo.



      netstat -lnp | grep 3306


      Kill/stop that process and restart your MySQL server. You are good to go.





      Execute below command to find my.cnf file in macbook.



      mysql --help | grep cnf


      You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.






      share|improve this answer























      • I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
        – shengfu zou
        Aug 15 '15 at 8:53












      • I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
        – shengfu zou
        Aug 15 '15 at 9:38










      • then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
        – Darshan Patel
        Aug 15 '15 at 9:59










      • This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
        – Grunion Shaftoe
        Nov 19 '18 at 16:55





















      0














      MySQL default port is 3306 but it may be unavailable for some reasons, try to restart your machine. Also sesrch for your MySQL configuration file (should be called "my.cnf") and check if the used port is 3306 or 3307, if is 3307 you can change it to 3306 and then reboot your MySQL server.






      share|improve this answer





























        0














        At rigth side in Navigator -> Instance-> Click on Startup/Shutdown -> Click on Start Server



        It will work surely






        share|improve this answer





























          0














          Go to system preferences, then "MySQL"



          Click on "Start MySQL Server"



          Go to system preferences, then "MySQL".
          Click on "Start MySQL Server".






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            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%2fstackoverflow.com%2fquestions%2f32022580%2ffailed-to-connect-to-mysql-at-localhost3306-with-user-root%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            6 Answers
            6






            active

            oldest

            votes








            6 Answers
            6






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Steps:



            1 - Right click on your task bar -->Start Task Manager



            2 - Click on Services button (at bottom).



            3 - Search for MYSQL57



            4 - Right Click on MYSQL57 --> Start



            Now again start your mysql-cmd-prompt or MYSQL WorkBench






            share|improve this answer


























              3














              Steps:



              1 - Right click on your task bar -->Start Task Manager



              2 - Click on Services button (at bottom).



              3 - Search for MYSQL57



              4 - Right Click on MYSQL57 --> Start



              Now again start your mysql-cmd-prompt or MYSQL WorkBench






              share|improve this answer
























                3












                3








                3






                Steps:



                1 - Right click on your task bar -->Start Task Manager



                2 - Click on Services button (at bottom).



                3 - Search for MYSQL57



                4 - Right Click on MYSQL57 --> Start



                Now again start your mysql-cmd-prompt or MYSQL WorkBench






                share|improve this answer












                Steps:



                1 - Right click on your task bar -->Start Task Manager



                2 - Click on Services button (at bottom).



                3 - Search for MYSQL57



                4 - Right Click on MYSQL57 --> Start



                Now again start your mysql-cmd-prompt or MYSQL WorkBench







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 10 '17 at 13:09









                Abhishek SinghAbhishek Singh

                312




                312

























                    2














                    Open System Preference > MySQL > Initialize Database > Use Legacy Password Encription






                    share|improve this answer


























                      2














                      Open System Preference > MySQL > Initialize Database > Use Legacy Password Encription






                      share|improve this answer
























                        2












                        2








                        2






                        Open System Preference > MySQL > Initialize Database > Use Legacy Password Encription






                        share|improve this answer












                        Open System Preference > MySQL > Initialize Database > Use Legacy Password Encription







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jun 2 '18 at 16:32









                        Hau LeHau Le

                        715




                        715























                            1














                            Try to execute below command in your terminal :



                            mysql -h localhost -P 3306 -u root -p


                            If you successfully connect to your database, then same thing has to happen with Mysql Workbench.



                            If you are unable to connect then I think 3306 port is acquired by another process.



                            Find which process running on 3306 port. If required, give admin privileges using sudo.



                            netstat -lnp | grep 3306


                            Kill/stop that process and restart your MySQL server. You are good to go.





                            Execute below command to find my.cnf file in macbook.



                            mysql --help | grep cnf


                            You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.






                            share|improve this answer























                            • I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                              – shengfu zou
                              Aug 15 '15 at 8:53












                            • I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                              – shengfu zou
                              Aug 15 '15 at 9:38










                            • then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                              – Darshan Patel
                              Aug 15 '15 at 9:59










                            • This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                              – Grunion Shaftoe
                              Nov 19 '18 at 16:55


















                            1














                            Try to execute below command in your terminal :



                            mysql -h localhost -P 3306 -u root -p


                            If you successfully connect to your database, then same thing has to happen with Mysql Workbench.



                            If you are unable to connect then I think 3306 port is acquired by another process.



                            Find which process running on 3306 port. If required, give admin privileges using sudo.



                            netstat -lnp | grep 3306


                            Kill/stop that process and restart your MySQL server. You are good to go.





                            Execute below command to find my.cnf file in macbook.



                            mysql --help | grep cnf


                            You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.






                            share|improve this answer























                            • I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                              – shengfu zou
                              Aug 15 '15 at 8:53












                            • I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                              – shengfu zou
                              Aug 15 '15 at 9:38










                            • then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                              – Darshan Patel
                              Aug 15 '15 at 9:59










                            • This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                              – Grunion Shaftoe
                              Nov 19 '18 at 16:55
















                            1












                            1








                            1






                            Try to execute below command in your terminal :



                            mysql -h localhost -P 3306 -u root -p


                            If you successfully connect to your database, then same thing has to happen with Mysql Workbench.



                            If you are unable to connect then I think 3306 port is acquired by another process.



                            Find which process running on 3306 port. If required, give admin privileges using sudo.



                            netstat -lnp | grep 3306


                            Kill/stop that process and restart your MySQL server. You are good to go.





                            Execute below command to find my.cnf file in macbook.



                            mysql --help | grep cnf


                            You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.






                            share|improve this answer














                            Try to execute below command in your terminal :



                            mysql -h localhost -P 3306 -u root -p


                            If you successfully connect to your database, then same thing has to happen with Mysql Workbench.



                            If you are unable to connect then I think 3306 port is acquired by another process.



                            Find which process running on 3306 port. If required, give admin privileges using sudo.



                            netstat -lnp | grep 3306


                            Kill/stop that process and restart your MySQL server. You are good to go.





                            Execute below command to find my.cnf file in macbook.



                            mysql --help | grep cnf


                            You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 21 '18 at 5:23

























                            answered Aug 15 '15 at 8:26









                            Darshan PatelDarshan Patel

                            1,93611529




                            1,93611529












                            • I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                              – shengfu zou
                              Aug 15 '15 at 8:53












                            • I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                              – shengfu zou
                              Aug 15 '15 at 9:38










                            • then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                              – Darshan Patel
                              Aug 15 '15 at 9:59










                            • This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                              – Grunion Shaftoe
                              Nov 19 '18 at 16:55




















                            • I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                              – shengfu zou
                              Aug 15 '15 at 8:53












                            • I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                              – shengfu zou
                              Aug 15 '15 at 9:38










                            • then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                              – Darshan Patel
                              Aug 15 '15 at 9:59










                            • This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                              – Grunion Shaftoe
                              Nov 19 '18 at 16:55


















                            I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                            – shengfu zou
                            Aug 15 '15 at 8:53






                            I use your command and show as below : ` order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf ` I check the four file ,and all then are empty.Why and what to do for me?
                            – shengfu zou
                            Aug 15 '15 at 8:53














                            I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                            – shengfu zou
                            Aug 15 '15 at 9:38




                            I use mysql -h localhost -P 3306 -u root -p to connect , but it show Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) I use mysql --help | grep cnf it show nothing.
                            – shengfu zou
                            Aug 15 '15 at 9:38












                            then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                            – Darshan Patel
                            Aug 15 '15 at 9:59




                            then use netstat commnad to find out which process is running for port 3306 and also execute mysql -h localhost -P 3307 -u root -p. If you got success with 3307 then your MySQL server is running on 3307 port.
                            – Darshan Patel
                            Aug 15 '15 at 9:59












                            This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                            – Grunion Shaftoe
                            Nov 19 '18 at 16:55






                            This works well on PC, but the command is : netstat -a -n -o ... on the command line (you may need admin privs) ... and then take the PID from the last column and look it up on the details pane of Task Manager (CTL+SHIFT+ESC) I was able to determine that yes, MySql is on that port ... Sadly, that doesn't mean that I actually solved the problem, but it's a great diagnostic step. ++
                            – Grunion Shaftoe
                            Nov 19 '18 at 16:55













                            0














                            MySQL default port is 3306 but it may be unavailable for some reasons, try to restart your machine. Also sesrch for your MySQL configuration file (should be called "my.cnf") and check if the used port is 3306 or 3307, if is 3307 you can change it to 3306 and then reboot your MySQL server.






                            share|improve this answer


























                              0














                              MySQL default port is 3306 but it may be unavailable for some reasons, try to restart your machine. Also sesrch for your MySQL configuration file (should be called "my.cnf") and check if the used port is 3306 or 3307, if is 3307 you can change it to 3306 and then reboot your MySQL server.






                              share|improve this answer
























                                0












                                0








                                0






                                MySQL default port is 3306 but it may be unavailable for some reasons, try to restart your machine. Also sesrch for your MySQL configuration file (should be called "my.cnf") and check if the used port is 3306 or 3307, if is 3307 you can change it to 3306 and then reboot your MySQL server.






                                share|improve this answer












                                MySQL default port is 3306 but it may be unavailable for some reasons, try to restart your machine. Also sesrch for your MySQL configuration file (should be called "my.cnf") and check if the used port is 3306 or 3307, if is 3307 you can change it to 3306 and then reboot your MySQL server.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Aug 15 '15 at 8:25









                                J0ker98J0ker98

                                1449




                                1449























                                    0














                                    At rigth side in Navigator -> Instance-> Click on Startup/Shutdown -> Click on Start Server



                                    It will work surely






                                    share|improve this answer


























                                      0














                                      At rigth side in Navigator -> Instance-> Click on Startup/Shutdown -> Click on Start Server



                                      It will work surely






                                      share|improve this answer
























                                        0












                                        0








                                        0






                                        At rigth side in Navigator -> Instance-> Click on Startup/Shutdown -> Click on Start Server



                                        It will work surely






                                        share|improve this answer












                                        At rigth side in Navigator -> Instance-> Click on Startup/Shutdown -> Click on Start Server



                                        It will work surely







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Jun 3 '18 at 7:14









                                        Tobia JohnTobia John

                                        12




                                        12























                                            0














                                            Go to system preferences, then "MySQL"



                                            Click on "Start MySQL Server"



                                            Go to system preferences, then "MySQL".
                                            Click on "Start MySQL Server".






                                            share|improve this answer


























                                              0














                                              Go to system preferences, then "MySQL"



                                              Click on "Start MySQL Server"



                                              Go to system preferences, then "MySQL".
                                              Click on "Start MySQL Server".






                                              share|improve this answer
























                                                0












                                                0








                                                0






                                                Go to system preferences, then "MySQL"



                                                Click on "Start MySQL Server"



                                                Go to system preferences, then "MySQL".
                                                Click on "Start MySQL Server".






                                                share|improve this answer












                                                Go to system preferences, then "MySQL"



                                                Click on "Start MySQL Server"



                                                Go to system preferences, then "MySQL".
                                                Click on "Start MySQL Server".







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Aug 29 '18 at 1:40









                                                almawhoobalmawhoob

                                                13914




                                                13914






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Stack Overflow!


                                                    • 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.





                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                    Please pay close attention to the following guidance:


                                                    • 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%2fstackoverflow.com%2fquestions%2f32022580%2ffailed-to-connect-to-mysql-at-localhost3306-with-user-root%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

                                                    Create new schema in PostgreSQL using DBeaver

                                                    Deepest pit of an array with Javascript: test on Codility

                                                    Costa Masnaga