4

I need to run MySQL service for my linux 2.16 version with SUSE version 11 distribution. Downloaded the following files and installed all the rpms as under:

MySQL-server-5.5.27-1.sles11.i586
MySQL-client-5.5.27-1.sles11.i586
MySQL-devel-5.5.27-1.sles11.i586
MySQL-shared-5.5.27-1.sles11.i586
MySQL-shared-compat-5.5.27-1.sles11.i586

There was no error during installation and I have confirmed the installed packages via:

rpm -qa|grep -i sql

But the server is not getting started when trying to execute through:

$> mysql

M getting the following as eror msg:

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

I have checked that in the /etc/init.d location, only mysql entry is there instead of mysqld, is this the reason of the server startup error.

On googling for hours, I have also tried ./mysql start from the same location but getting the following output:

Starting MySQL..The server quit without updating PID file (/var/lib/mysql/ABC2-rahul.pid).

I am new to mysql, any help will be appreciated. Thanks in advance.


I have cheked and found that some configuration files have been in the /usr/share/mysql loaction, and I have copied my-huge.cnf file to /etc location, any comments ?

Following is the content from the same my.cnf file:

[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M

thread_concurrency = 8

log-bin=mysql-bin

server-id       = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
2
  • Did you look in the log file? /var/log/mysql.err
    – bahamat
    Sep 27, 2012 at 0:20
  • I keep searching for the log files, but none of them has been created in the /var/log location !!
    – Manroop
    Sep 27, 2012 at 4:47

3 Answers 3

5

Have you tried starting the mysql service? Run this as root:

service mysql start

or

/etc/init.d/mysql start 

If it still doesn't work try one of the following. All these commands should be run as root:

  • Rename your my.cnf file. That will force mysql to create a new one:

    mv /etc/my.cnf /etc/my.cnf.old
    
  • Make sure your permissions are set up correctly:

    chown -R mysql /var/lib/mysql
    

    Change /var/lib/mysql to the appropriate path of your mysql installation is somewhere else.

The solutions here may also be helpful.

9
  • Yes i have started the same, as u r saying, but facing the error like server quit without updating file (erroneous output posted above in my question).
    – Manroop
    Sep 26, 2012 at 11:22
  • @Manroop - Make sure you are running this as root. The error is probably because you don't have the right permissions. Sep 26, 2012 at 11:42
  • @Manroop please see my updated answer (and make sure you are running everything as root as suggested above).
    – terdon
    Sep 26, 2012 at 11:43
  • @ire_and_curses yes I am running all these stuff as a root user only.
    – Manroop
    Sep 26, 2012 at 12:07
  • @terdon yes you are right, but I am also looking for thar file my.cnf under /etc/init.d location, its not there :(
    – Manroop
    Sep 26, 2012 at 12:08
0

Have you updated my.cnf in /etc? Just installing and expecting it to run will not get MySQL started. You can also review this to help:

https://dev.mysql.com/tech-resources/articles/mysql_intro.html

and

https://dev.mysql.com/doc/refman/5.5/en/postinstallation.html

3
  • So this says one needs to create such 'my.cnf' file if its not in the said location /etc/init.d as in my case also.
    – Manroop
    Sep 26, 2012 at 12:12
  • my.cnf should go in /etc, not /etc/init.d
    – slafat01
    Sep 26, 2012 at 14:16
  • checked there also, but nothing found
    – Manroop
    Sep 27, 2012 at 4:53
0

in my case, when I installed lamp packages, I dont know server had installed mysql by default, that's why always conflict when install MYSQL.

first, I check by 'ps -ef ' and found mysql already running on system. I kill all related with service sql, and running again '/opt/lampp/lampp restart.

my problem fix, I dont know with your issue, but better with first step you should try 'ps -ef' check mysql maybe running on your system

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .