[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. :wink:

Error I receive is:

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

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.

Hi,

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

/etc/init.d/mysqld start

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

well, that would be (as root):

# 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).

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:

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.

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.