Results 1 to 7 of 7

Thread: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

  1. #1

    Default [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    Hello,

    I've downloaded and installed MySQL-client-5.1.53-1.glibc23.x86_64.rpm. I'm rather new to linux so it might be I haven't started the server. Unfortunately I have no idea which file is responsible for that. It is also possible that my head isn't functioning correctly ( if at all ) since I haven't slept well so please don't eat me alive. Kill me at least.

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

  2. #2
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    This means that the mysql server is not running (and thus there is no socket). You must install the server packet as well and then start it as a service with yast from the system menu.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  3. #3
    Join Date
    Jul 2009
    Location
    Montreal, Québec
    Posts
    833

    Default Re : Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    Hi,

    If I'm correct (I'm not sure I remember), the command to start the server is :

    Code:
    /etc/init.d/mysqld start

  4. #4
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: Re : Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    If I'm correct (I'm not sure I remember), the command to start the server is:
    ...

    well, that would be (as root):

    Code:
    # rcmysql start
    but when the service is enabled with yast the proper links to the startup script will be generated and it is permanent (starting automatically after each reboot).
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  5. #5

    Default Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    You need to include permissions on the free Amazon EC2 micro instance in order to start MySQL:
    sudo /etc/init.d/mysqld start

    After the proper command, the MySQL server initializes with system tables and additional config info:
    Initializing MySQL database: Installing MySQL system tables...
    OK
    Filling help tables...
    OK

    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:

    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h ip-10-205-15-154 password 'new-password'

    Alternatively you can run:
    /usr/bin/mysql_secure_installation

    which will also give you the option of removing the test
    databases and anonymous user created by default. This is
    strongly recommended for production servers.

    See the manual for more instructions.

    You can start the MySQL daemon with:
    cd /usr ; /usr/bin/mysqld_safe &

    You can test the MySQL daemon with mysql-test-run.pl
    cd /usr/mysql-test ; perl mysql-test-run.pl

    Please report any problems with the /usr/bin/mysqlbug script!

    [ OK ]
    Starting mysqld:

  6. #6
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    On Mon, 06 Dec 2010 19:36:02 +0530, DaaX <DaaX@no-mx.forums.opensuse.org>
    wrote:

    >
    > Hi,
    >
    > If I'm correct (I'm not sure I remember), the command to start the
    > server is :
    >
    >
    > Code:
    > --------------------
    > /etc/init.d/mysqld start
    > --------------------


    actually it's "/etc/init.d/mysql start". but in openSUSE you can just do
    "rcmysql start" from the command line (as root).


    --
    phani.

  7. #7
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: [MySQL] ERROR 2002 (HY000): Can't connect to local MySQL...

    On Mon, 06 Dec 2010 23:06:01 +0530, chaochou2
    <chaochou2@no-mx.forums.opensuse.org> wrote:

    >
    > You need to include permissions on the free Amazon EC2 micro instance in
    > order to start MySQL:
    > sudo /etc/init.d/mysqld start
    >
    > After the proper command, the MySQL server initializes with system
    > tables and additional config info:
    > Initializing MySQL database: Installing MySQL system tables...
    > OK
    > Filling help tables...
    > OK
    >
    > To start mysqld at boot time you have to copy
    > support-files/mysql.server to the right place for your system
    >
    > PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    > To do so, start the server, then issue the following commands:
    >
    > /usr/bin/mysqladmin -u root password 'new-password'
    > /usr/bin/mysqladmin -u root -h ip-10-205-15-154 password
    > 'new-password'
    >
    > Alternatively you can run:
    > /usr/bin/mysql_secure_installation
    >
    > which will also give you the option of removing the test
    > databases and anonymous user created by default. This is
    > strongly recommended for production servers.
    >
    > See the manual for more instructions.
    >
    > You can start the MySQL daemon with:
    > cd /usr ; /usr/bin/mysqld_safe &
    >
    > You can test the MySQL daemon with mysql-test-run.pl
    > cd /usr/mysql-test ; perl mysql-test-run.pl
    >
    > Please report any problems with the /usr/bin/mysqlbug script!
    >
    > [ OK ]
    > Starting mysqld:
    >


    that's exactly as it should be. your mysql is running, and if you want it
    to start every time your system start, you should specify this in YAST's
    runlevel editor. you should also read the documentation at
    http://dev.mysql.com/doc/refman/5.1/en/ -- at least the parts that are
    relevant to your needs. the short description, how to set up a root
    account (for mysql) with a password, is already included in the command
    output you posted here; a little more know-how would be better.


    --
    phani.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •