Hi,

I've had mysql running fine on localhost but now it wont connect and I cant figure out why.

all i get is this error:

ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

and..

MYSQLADMIN: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

and..

C:\MYSQL\BIN>telnet localhost 3306
Connecting To localhost...Could not open connection to the host, on port 3306.
No connection could be made because the target machine actively refused it.

Any idea's? I'm really stuck!

Thanks,

    You're on Windows. Look in the Task Manager for mysqld. If it's there, it's running. Otherwise, you need to to do a NET START mysqld

      Its not running.

      how do i do a net start mysqld?

      C:\MYSQL\BIN>NET START mysqld
      The service name is invalid.

        C:\MYSQL\BIN>net start mysql
        The MySql service is starting.
        The MySql service was started successfully.

        C:\MYSQL\BIN>mysqlshow
        MYSQLSHOW: Can't connect to MySQL server on 'localhost' (10061)

        C:\MYSQL\BIN>

          Is it in task manager now? I'm thinking you may have some problems with the install, so it's stopping as it starts...

            Before it stopped working, I deleted a couple of databases in phpmyadmin.

            I think that may have something to do with it. I'm not very clued up with mysql admin.

            I have not edited any of the config recently though.

              Ahhhhhhhhh....did you delete the "mysql" database? If so, re-install. That database is vital to mysql running.

                If i re-instsall it, will i lose my other databases and the data in it?

                  make a copy of C:\mysql\data. That folder contains all of the databases you have. One the new install is done, you can paste the contents of the backup into the new data folder(don't actually over-ride anything), and mysql will rebuild the indexes and data for your old databases.

                    Write a Reply...