Results 1 to 4 of 4

Thread: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

  1. #1
    Join Date
    Jul 2009
    Posts
    99

    Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

    Hello,

    I work under Redhat 4.0, By default, I installed the packages Mysql and Apache. I have no problem to start Apache ... However, I can not start Mysql, I have the error:

    Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

    I think, there is a problem of installing MySQL. The file/var/lib/mysql/mysql.sock does not exist, the directory var/lib/mysql is not!

    When I type the command: whereis mysql

    HTML Code:
    mysql:/usr/bin/mysql/usr/lib/mysql/usr/include/mysql/usr/share/mysql/usr/share/man/man1/mysql.1.gz
    When I type the command: rpm-qa | grep mysql

    HTML Code:
      mysql-4.1.20-2.RHEL4.1.0.1 
      mysql-devel-4.1.20-2.RHEL4.1.0.1 
      perl-DBD-mysql-4008-1.el4.rf 
      mysqlclient10-3.23.58-4.RHEL4.1 
      libdbi-dbd-mysql-0.6.5-10.RHEL4.1 
      mysqlclient10-3.23.58-4.RHEL4.1 
      mysql-4.1.20-2.RHEL4.1.0.1
    What should I do to resolve this error and start mysql?

    Do I have to uninstall and reinstall mysql mysql?

    Thank you in advance for your help

  2. #2
    Join Date
    May 2008
    Posts
    372

    Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

    First of all, install the database in MySQL: To solve this problem, just follow these steps:

    HTML Code:
    # Mysql_install_db
    Next you need to generate the sock:

    HTML Code:
    # Chown-R mysql.mysql/var/lib/mysql
    Now let's start in the MySQL server:

    HTML Code:
    # Safe_mysqld &
    your MySQL is already running!

    Open another terminal window and type:

    HTML Code:
    # Mysql

  3. #3
    Join Date
    Jul 2009
    Posts
    99

    Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

    Thank you for responding so quickly

    I have no file /var/log/mysqld.log
    There are no files on my server mysqld.log


    Here is what I have in my file more /etc/my.cnf

    HTML Code:
      [mysqld] 
      datadir=/var/lib/mysql 
      socket =/var/lib/mysql/mysql.sock 
      # Default to using old password format for compatibility with mysql 3.x 
      # Clients (those using the mysqlclient10 compatibility package). 
      old_passwords = 1 
    
      [mysql.server] 
      user = mysql 
      basedir = /var/lib 
    
      [mysqld_safe] 
      err-log=/var/log/mysqld.log 
      pid-file=/var/run/mysqld/mysqld.pid
    There is a socket =/var/lib/mysql/mysql.sock but I do not know what to put in the place because I have no mysql.sock file on my server

    What should I do? Uninstall and reinstall mysql?

    Thank you in advance for your help

  4. #4
    Join Date
    Mar 2008
    Posts
    335

    Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2

    There are no files on my server mysqld.log
    But you should have a my.cnf dixit

    [mysqld_safe]
    err-log=/var/log/mysqld.log
    tries to create
    /var/lib/mysql/mysql.sock

    and recover mysqld

Similar Threads

  1. Replies: 4
    Last Post: 13-01-2011, 01:08 AM
  2. mysql config file in MySQL
    By Netorious in forum Software Development
    Replies: 4
    Last Post: 18-03-2010, 09:43 PM
  3. cannot connect to local MySQL server in Debian 4
    By Protoplasm in forum Networking & Security
    Replies: 4
    Last Post: 06-05-2009, 12:38 PM
  4. MySQL: connection problem of socket
    By Bull50 in forum Software Development
    Replies: 4
    Last Post: 31-03-2009, 12:00 AM
  5. How to Connect or Disconnect from the MYSQL Server
    By GaryK in forum Software Development
    Replies: 1
    Last Post: 10-02-2009, 12:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,721,254,129.83419 seconds with 17 queries