Problem installing MySQL on suse 10.3

Discussion in 'Installation/Configuration' started by Txchaser, Apr 15, 2008.

  1. Txchaser

    Txchaser New Member

    This is now the 3rd time I have wiped out and done a clean install of suse and keep running into the same poroblem when trying to install mysql.
    I get as far as inputting the admin. pass once i try to add the admin pass I get the following error:

    mysqladmin -u root password *******
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

    As far as I know mysql is running as it has been stopped then restarted with no errors. I also have checked to see if the mysql.sock file is in the directory in which it is not. Here Is what is in the directory:

    svr1:~ # cd /var/lib/mysql
    svr1:/var/lib/mysql # dir
    total 20540
    drwx------ 2 mysql mysql 4096 Apr 10 09:58 .protected
    -rw-r--r-- 1 mysql mysql 0 Apr 15 12:51 .run-mysql_upgrade
    drwxr-xr-x 2 mysql mysql 4096 Apr 10 09:58 .tmp
    -rw-rw---- 1 mysql mysql 5242880 Apr 15 12:42 ib_logfile0
    -rw-rw---- 1 mysql mysql 5242880 Apr 15 12:41 ib_logfile1
    -rw-rw---- 1 mysql mysql 10485760 Apr 15 12:42 ibdata1
    drwx------ 2 mysql mysql 4096 Apr 15 12:41 mysql
    -rw-rw---- 1 mysql mysql 1041 Apr 15 12:41 mysqld.log
    drwx------ 2 mysql mysql 4096 Apr 15 12:40 test

    I have noticed searching through the various sites that there seems to be quite a few people with the same problem, I just could not find a clear solution to the problem any help would be appreciated. Without this being resolved I can not continue my installation.
     
    Last edited: Apr 15, 2008
  2. o.meyer

    o.meyer New Member Moderator

    Hi Txchaser,

    please paste the output of

    Code:
    cat /etc/my.cnf
    Best regards,

    Olli
     
  3. Txchaser

    Txchaser New Member

    thanks for reply heres the output you were wanting

    svr1:~ # cat /etc/my.cnf
    # Example MySQL config file for medium systems.
    #
    # This is for a system with little memory (32M - 64M) where MySQL plays
    # an important part, or systems up to 128M where MySQL is used together with
    # other programs (such as a web server)
    #
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is /var/lib/mysql) or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.

    # The following options will be passed to all MySQL clients
    [client]
    #password = your_password
    port = 3306
    socket = /var/lib/mysql/mysql.sock

    # Here follows entries for some specific programs

    # The MySQL server
    [mysqld]
    port = 3306
    socket = /var/lib/mysql/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M

    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!
    #

    # Replication Master Server (default)
    # binary logging is required for replication
    # log-bin=mysql-bin

    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id = 1

    # Replication Slave (comment out master section to use this)
    #
    # To configure this host as a replication slave, you can choose between
    # two methods :
    #
    # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
    # the syntax is:
    #
    # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
    # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
    #
    # where you replace <host>, <user>, <password> by quoted strings and
    # <port> by the master's port number (3306 by default).
    #
    # Example:
    #
    # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
    # MASTER_USER='joe', MASTER_PASSWORD='secret';
    #
    # OR
    #
    # 2) Set the variables below. However, in case you choose this method, then
    # start replication for the first time (even unsuccessfully, for example
    # if you mistyped the password in master-password and the slave fails to
    # connect), the slave will create a master.info file, and any later
    # change in this file to the variables' values below will be ignored and
    # overridden by the content of the master.info file, unless you shutdown
    # the slave server, delete master.info and restart the slaver server.
    # For that reason, you may want to leave the lines below untouched
    # (commented) and instead use CHANGE MASTER TO (see above)
    #
    # required unique id between 2 and 2^32 - 1
    # (and different from the master)
    # defaults to 2 if master-host is set
    # but will not function as a slave if omitted
    #server-id = 2
    #
    # The replication master for this slave - required
    #master-host = <hostname>
    #
    # The username the slave will use for authentication when connecting
    # to the master - required
    #master-user = <username>
    #
    # The password the slave will authenticate with when connecting to
    # the master - required
    #master-password = <password>
    #
    # The port the master is listening on.
    # optional - defaults to 3306
    #master-port = <port>
    #
    # binary logging - not required for slaves, but recommended
    #log-bin=mysql-bin

    # Point the following paths to different dedicated disks
    #tmpdir = /tmp/
    #log-update = /path-to-dedicated-directory/hostname

    # Uncomment the following if you are using BDB tables
    #bdb_cache_size = 4M
    #bdb_max_lock = 10000

    # Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = /var/lib/mysql/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /var/lib/mysql/
    #innodb_log_arch_dir = /var/lib/mysql/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50

    # The safe_mysqld script
    [safe_mysqld]
    log-error=/var/lib/mysql/mysqld.log

    [mysqldump]
    quick
    max_allowed_packet = 16M

    [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates

    [isamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [myisamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_multi]
    mysqld = /usr/bin/mysqld_safe
    mysqladmin = /usr/bin/mysqladmin
    log = /var/log/mysqld_multi.log
    # user = multi_admin
    # password = secret

    # If you want to use mysqld_multi uncomment 1 or more mysqld sections
    # below or add your own ones.

    # WARNING
    # --------
    # If you uncomment mysqld1 than make absolutely sure, that database mysql,
    # configured above, is not started. This may result in corrupted data!
    # [mysqld1]
    # port = 3306
    # datadir = /var/lib/mysql
    # pid-file = /var/lib/mysql/mysqld.pid
    # socket = /var/lib/mysql/mysql.sock
    # user = mysql

    # [mysqld2]
    # port = 3307
    # datadir = /var/lib/mysql-databases/mysqld2
    # pid-file = /var/lib/mysql-databases/mysqld2/mysql.pid
    # socket = /var/lib/mysql-databases/mysqld2/mysql.sock
    # user = mysql

    # [mysqld3]
    # port = 3308
    # datadir = /var/lib/mysql-databases/mysqld3
    # pid-file = /var/lib/mysql-databases/mysqld3/mysql.pid
    # socket = /var/lib/mysql-databases/mysqld3/mysql.sock
    # user = mysql

    # [mysqld6]
    # port = 3309
    # datadir = /var/lib/mysql-databases/mysqld6
    # pid-file = /var/lib/mysql-databases/mysqld6/mysql.pid
    # socket = /var/lib/mysql-databases/mysqld6/mysql.sock
    # user = mysql

    svr1:~ #
     
  4. o.meyer

    o.meyer New Member Moderator

    Hi Txchaser,

    taken from the MySQL troubleshooting page:

    "[...]You also need to ensure that clients have permission to access the mysql.sock file.[...]"

    So it might be a problem with the rights. Please paste the output of

    Code:
    ls -la /var/lib/mysql/
    Best regards,

    Olli
     
  5. Txchaser

    Txchaser New Member

    output of ls -la /var/lib/mysql/

    svr1:~ # ls -la /var/lib/mysql/
    total 20548
    drwxr-xr-x 6 mysql mysql 4096 Apr 10 09:58 .
    drwxr-xr-x 29 root root 4096 Apr 15 11:02 ..
    drwx------ 2 mysql mysql 4096 Apr 10 09:58 .protected
    -rw-r--r-- 1 mysql mysql 0 Apr 15 12:51 .run-mysql_upgrade
    drwxr-xr-x 2 mysql mysql 4096 Apr 10 09:58 .tmp
    -rw-rw---- 1 mysql mysql 5242880 Apr 15 12:42 ib_logfile0
    -rw-rw---- 1 mysql mysql 5242880 Apr 15 12:41 ib_logfile1
    -rw-rw---- 1 mysql mysql 10485760 Apr 15 12:42 ibdata1
    drwx------ 2 mysql mysql 4096 Apr 15 12:41 mysql
    -rw-rw---- 1 mysql mysql 1041 Apr 15 12:41 mysqld.log
    drwx------ 2 mysql mysql 4096 Apr 15 12:40 test
     
  6. o.meyer

    o.meyer New Member Moderator

    Sorry, I read over that no socket was created on your system. Are you sure that the mysql server is running? What is the output of

    Code:
    netstat -ln | grep mysql
    and

    Code:
    netstat -tap | grep mysql
    Best regards,

    Olli
     
  7. Txchaser

    Txchaser New Member

    thanks for fast replies :)

    svr1:~ # netstat -tap | grep mysql
    svr1:~ #

    This is all I get. Im not sure what is going on, I forgot to mention that this was another problem as well on one of the other installs I tried. It is acting like it is not running. I have tried /etc/init.d/mysql start to start it and then run netstat -tap | grep mysql and still get nothing. I have also tried /etc/init.d/mysql restart to restart it and it says it terminates and then restarts but still get nothing from netstat -tap | grep mysql. Each install that I have done I have followed falkos tutorial and made sure I havent missed anything.
     
  8. o.meyer

    o.meyer New Member Moderator

    The mysql server is not running. Have you looked into the mysql-log?

    Best regards,

    Olli
     
  9. Txchaser

    Txchaser New Member

    hope this was the correct log file

    mysqld log:
    080415 12:41:23 mysqld started

    InnoDB: The first specified data file ./ibdata1 did not exist:

    InnoDB: a new database to be created!

    080415 12:41:23 InnoDB: Setting file ./ibdata1 size to 10 MB

    InnoDB: Database physically writes the file full: wait...

    080415 12:41:28 InnoDB: Log file ./ib_logfile0 did not exist: new to
    be created

    InnoDB: Setting log file ./ib_logfile0 size to 5 MB

    InnoDB: Database physically writes the file full:
    wait...

    080415 12:41:31 InnoDB: Log file ./ib_logfile1 did not exist: new to
    be created

    InnoDB: Setting log file ./ib_logfile1 size to 5 MB

    InnoDB: Database physically writes the file full: wait...

    InnoDB: Doublewrite buffer not found: creating new

    InnoDB: Doublewrite buffer created

    InnoDB: Creating foreign key constraint system tables

    InnoDB: Foreign key constraint system tables created

    080415 12:41:57
    InnoDB: Started; log sequence number 0 0
    080415 12:41:57
    [Note] /usr/sbin/mysqld: ready for connections.

    Version: '5.0.45' socket: '/var/lib/mysql/.protected/mysql.sock'
    port: 0 SUSE MySQL RPM


    everything that I have been trying to do i noticed that it is looking for mysql.sock in this directory "/var/lib/mysql/" and it is actually in '/var/lib/mysql/.protected/mysql.sock' I con not move it from that directory for some reason.
    Also by reading this log am I correct by assuming that it is set to port 0 and when I am running the connection it is looking for connection port of 3060 I belive is what it was?
     
  10. o.meyer

    o.meyer New Member Moderator

    Hi Txchaser,

    please try the following - in the my.cf ...

    change:

    Code:
    socket = /var/lib/mysql/mysql.sock
    to:

    Code:
    socket = /var/lib/mysql/.protected/mysql.sock
    After that restart/start the mysql server and check again if it is running wit the both netstat commands.

    Best regards,

    Olli
     
  11. Txchaser

    Txchaser New Member

    Have searched all through my server and cant seem to locate my.cf ... and tried to do a find for it as well : find / -name
    unless I overlooked it somewhere where would it be ?
     
  12. o.meyer

    o.meyer New Member Moderator

    Hi Txchaser,

    Code:
    /etc/my.cnf
    Best regards,

    Olli
     
  13. Txchaser

    Txchaser New Member

    Hey olli thanks for all of your help I belive I have messed up somewhere and am wanting to know if there is a way to delete the mysql install and start with fresh install following the how-to and the things you have given me to do?
     
  14. o.meyer

    o.meyer New Member Moderator

    Hi Txchaser,

    you should remove the mysql-packages with yast2 and afterwards install them again - also with yast2.

    Code:
    yast2
    Best regards,

    Olli
     
  15. Txchaser

    Txchaser New Member

    Hi Olli
    I decided I would start all over with fresh install from begining re-install OS and everything. I have no problems following the how-to but when it coes to installing mysql I get the following error and is now the point I am at.
    svr1:# chkconfig --add mysql
    mysql 0 off 1 off 2:eek:n 3 on 4 off 5:eek:n 6 off
    svr1:# /etc/init.d/mysql start
    Creating MySQL privilege database...
    Installing MySQL system tables...
    OK
    Filling help tables...

    ect....
    ect...

    Support MySQL by buying support/licenses at http://shop.mysql.com
    Updating MySQL privilege database...
    failed
    svr1:#
     
  16. o.meyer

    o.meyer New Member Moderator

    Which howto do you mean?

    Olli
     
  17. Txchaser

    Txchaser New Member

  18. falko

    falko Super Moderator Howtoforge Staff

    Did you switch off AppArmor?
     
  19. Txchaser

    Txchaser New Member

    Yes apparmor turned off still getting the same thing also another question, now scince this is the 4th time on fresh install about to be a 5t it looks like, mysql is looking for socket in /var/lib/mysql/mysql.sock when on every instal I do it is actually located in /var/lib/mysql/.protected/mysql.sock I am guessing I need to change this in /etc/my.cnf before I try to start my sql correct? Also when changing the location in my.cnf does it need to be changed in both [client] and [mysqld] ?
     
  20. falko

    falko Super Moderator Howtoforge Staff

    You can try to create a symlink from /var/lib/mysql/mysql.sock to /var/lib/mysql/.protected/mysql.sock. That way you don't have to modify your my.cnf.
     

Share This Page