Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Recently installed MySQL server on a newly installed Fedora, Created a few tables and change the error logs in *********************************************** /etc/my.cnf *********************************************** [mysqld] # Settings user and group are ignored ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40

    Can't connect to local MySQL server


    Recently installed MySQL server on a newly installed Fedora,
    Created a few tables and change the error logs in
    ***********************************************
    /etc/my.cnf
    ***********************************************
    [mysqld]
    # Settings user and group are ignored when systemd is used.
    # If you need to run mysqld under different user or group,
    # customize your systemd unit file for mysqld according to the
    # instructions in[NEWBI - FedoraProject]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0

    [mysqld]
    log-error-/var/log/mysql/error.log
    tmpdir=/tmp/myslqtmp

    [mysqld_safe]
    log-error=/var/log/mysql/safeerror.log
    pid-file=/var/run/mysqld/mysqld.pid --warnings
    ************************************************** ********

    So now has error when cmdline access from command line, mysql replies with.
    [root mysql]# mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


    (there is no mysql.sock as a file in that directory, and the log in that directory shows all commands for a while then a series of empty value lines (no time stamp) as:

    /usr/libexec/mysqld, Version: 5.5.28-log (MySQL Community Server (GPL)). started with:
    Tcp port: 0 Unix socket: /var/lib/mysql/mysql.sock
    Time Id Command Argument
    /usr/libexec/mysqld, Version: 5.5.28-log (MySQL Community Server (GPL)). started with:
    Tcp port: 0 Unix socket: /var/lib/mysql/mysql.sock
    Time Id Command Argument
    rt: 0 Unix socket: /var/lib/mysql/mysql.sock
    Time Id Command Argument


    Already changed ownership and group permission in the log directory
    [root mysql]# pwd
    /var/log/mysql
    [root mysql]# ls -al
    total 20
    drwxr-x---. 2 mysql mysql 4096 Sep 18 14:12 .
    drwxr-xr-x. 15 root root 4096 Nov 8 03:27 ..
    -rw-r-----. 1 mysql mysql 10383 Oct 31 11:48 safeerror.log
    [root mysql]#

    Ummm…. Not sure what I did to it, so what do I do next?

  2. #2
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    the url I'm too new to post was : fedoraproject.org/wiki/Systemd

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,318
    Hi,

    Make sure it is started, e.g. (as root):

    Code:
    systemctl restart mysqld.service
    make sure it is running, e.g.:

    Code:
    # use the systemctl tool to check the service
    systemctl status mysqld.service
    
    # use ps to search running processes
    ps auxww|grep mysqld
    
    # scan localhost for open ports
    nmap -n localhost
    if it is still not running, check the logs:
    Code:
    /var/log/messages
    /var/log/mysql.log
    if it is running, connect locally, eg.:
    Code:
    mysql -u root
    if connecting from a remote box, check if the firewall is running by running the nmap command from that remote machine:
    Code:
    nmap -n <mysql_server_ipaddress>
    if you cannot see the mysql port, then on the mysql server, stop the firewall temporarily and see if you can connect:
    Code:
    systemctl stop iptables.service
    you can insert a firewall rule, if that is the problem.

  4. #4
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    Hmmmm... no isn't starting. error from safe mysql to mysld as:

    Code:
    [ shane]# systemctl restart mysqld.service
    Job failed. See system journal and 'systemctl status' for details.
    [ shane]# systemctl start mysqld.service
    Job failed. See system journal and 'systemctl status' for details.
    [ shane]# ps auxww | grep mysqld
    root      7621  0.0  0.0   4760   808 pts/0    S+   15:17   0:00 grep --color=auto mysqld
    [ shane]# nmap -n localhost
    bash: nmap: command not found...
    [ shane]# service mysqld startd
    Redirecting to /bin/systemctl startd  mysqld.service
    Unknown operation startd
    [ shane]# ps auxww | grep mysqld
    root      7726  0.0  0.0   4760   812 pts/0    S+   15:23   0:00 grep --color=auto mysqld
    [ shane]# systemctl enable mysqld.service
    [ shane]# ps auxww | grep mysqld
    root      7735  0.0  0.0   4760   812 pts/0    S+   15:24   0:00 grep --color=auto mysqld
    [ shane]# systemctl start mysqld.service
    Job failed. See system journal and 'systemctl status' for details.
    
    [ shane]#
    [ shane]#
    [ shane]#
    [ shane]#
    [ shane]#
    [ shane]# systemctl status mysqld.service
    mysqld.service - MySQL database server
              Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled)
              Active: failed (Result: exit-code) since Thu, 15 Nov 2012 15:25:03 -0500; 33s ago
             Process: 7771 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE)
             Process: 7770 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)
             Process: 7747 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir %n (code=exited, status=0/SUCCESS)
              CGroup: name=systemd:/system/mysqld.service
    
    Nov 15 15:25:02 rd.reagent.com mysqld_safe[7770]: sed: -e expression #1, char 21: unknown option to `s'
    Nov 15 15:25:02 rd.reagent.com mysqld_safe[7770]: 121115 15:25:02 mysqld_safe Logging to '/var/log/mysql/safeerror.log'.
    Nov 15 15:25:02 rd.reagent.com mysqld_safe[7770]: 121115 15:25:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    Nov 15 15:25:02 rd.reagent.com mysqld_safe[7770]: 121115 15:25:02 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
    [ shane]# mysql
    Last edited by atreyu; 11-15-2012 at 10:36 PM. Reason: inserted code tags for readability

  5. #5
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    No InnoDB??????? from cat /var/log/mysql/safeerror.log

    Code:
    121115 15:25:02 [Note] /usr/libexec/mysqld: Shutdown complete
    
    121115 15:25:02 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
    121115 16:14:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    121115 16:14:58 [Warning] The syntax '--log' is deprecated and will be removed in a future release. Please use '--general-log'/'--general-log-file' instead.
    121115 16:14:58 [Note] Plugin 'FEDERATED' is disabled.
    121115 16:14:58 InnoDB: The InnoDB memory heap is disabled
    121115 16:14:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    121115 16:14:58 InnoDB: Compressed tables use zlib 1.2.5
    121115 16:14:58 InnoDB: Using Linux native AIO
    /usr/libexec/mysqld: Can't create/write to file '/tmp/myslqtmp/ibEkThRr' (Errcode: 2)
    121115 16:14:58  InnoDB: Error: unable to create temporary file; errno: 2
    121115 16:14:58 [ERROR] Plugin 'InnoDB' init function returned error.
    121115 16:14:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    121115 16:14:58 [ERROR] Unknown/unsupported storage engine: InnoDB
    121115 16:14:58 [ERROR] Aborting
    
    121115 16:14:58 [Note] /usr/libexec/mysqld: Shutdown complete
    
    121115 16:14:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
    121115 16:16:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    121115 16:16:37 [Warning] The syntax '--log' is deprecated and will be removed in a future release. Please use '--general-log'/'--general-log-file' instead.
    121115 16:16:37 [Note] Plugin 'FEDERATED' is disabled.
    121115 16:16:37 InnoDB: The InnoDB memory heap is disabled
    121115 16:16:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    121115 16:16:37 InnoDB: Compressed tables use zlib 1.2.5
    121115 16:16:37 InnoDB: Using Linux native AIO
    /usr/libexec/mysqld: Can't create/write to file '/tmp/myslqtmp/ib0T8nd9' (Errcode: 2)
    121115 16:16:38  InnoDB: Error: unable to create temporary file; errno: 2
    121115 16:16:38 [ERROR] Plugin 'InnoDB' init function returned error.
    121115 16:16:38 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    121115 16:16:38 [ERROR] Unknown/unsupported storage engine: InnoDB
    121115 16:16:38 [ERROR] Aborting
    
    121115 16:16:38 [Note] /usr/libexec/mysqld: Shutdown complete
    
    121115 16:16:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
    [ mysql]#
    Last edited by atreyu; 11-15-2012 at 10:37 PM. Reason: inserted code tags for readability

  6. #6
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40

    I haven't seen an answer that works

    have no idea.. some bugzilla said to edit
    Commented out PrivateTmp=true -> #PrivateTmp=true in
    /usr/lib/systemd/system/mysqld.service
    /etc/systemd/system/multi-user.target.wants/mysqld.service

    no change though.. from bugzilla.redhat.com/show_bug.cgi?id=782513
    Last edited by atreyu; 11-15-2012 at 10:40 PM. Reason: fixed link on behalf of poster

  7. #7
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    Point is... IT WAS WORKING, edited some tables, was about to enter data, came back next day. gone.. did edit the my.cnf ... I'll wait for answer rather than guessing...

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,318
    Code:
    Nov 15 15:25:02 rd.reagent.com mysqld_safe[7770]: sed: -e expression #1, char 21: unknown option to `s'
    That error in your log file is quite odd. I guess it is coming from the /usr/bin/mysqld_safe shell script (which has many calls to sed in it). Have you modified that script? Check the validity of the package that owns it:
    Code:
    rpm -qV mysql-server
    also, off the wall, how is your disk space?

  9. #9
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    I kept exact notes for each step (besides the mysql build tables)
    cat buildnotes

    Development Web Server Creation Log:

    August 17:

    Fedora 17 DVD with Web Server Option, 1094 Packages auto installed

    Install updates (386)

    (Error Log : tail -f /var/log/httpd/error.log)

    (change server name /etc/sysconfig/network and ***** )

    August 18:

    Super User Typed:

    systemctl enable httpd.service

    Created /var/www/libraries

    Copied programs to /var/www/cgi-bin

    testdbi.pl

    showenv.pl

    Copied programs to /var/www/libraries

    Super user typed: yum install perl-CGI

    ***********************************************

    perl -e shell -MCPAN
    then type

    install CPAN
    reload CPAN
    install CGI

    ************************************************** *

    (Installed MYSQL 5.5.27)

    Yum install myql

    Yum install mysql-server

    Yum install mysql-devel

    Chgrp -R mysql /var/lib/mysql

    Chmod -R 770 /var/lib/mysql

    Service mysqld startd (see systemctl enable mysqld.service maybe?)systemctl status mysqld.service


    ************************************************** *****

    **************************************************
    ************************************************** *****

    MYSQL WEBSERVER Member confingeration

    /etc/httpd/conf/httpd.conf

    <Directory /var/httpd/cgi-bin>
    AuthType Basic
    AuthName "Please to enter your Member Name and your private password."
    AuthMySQLHost localhost
    AuthMySQLUser db_user
    AuthMySQLPassword db_password
    AuthMYSQLNoPasswd On
    AuthMySQLDB http_membership
    AuthMysqlUserTable myauth
    AuthMySQLPwEncryption none
    AuthMYSQLKeepAlive Off
    AuthMySQLEnable on require valid-user
    </Directory>



    root#
    mkdir /var/log/mysql
    chown mysql:mysql /var/log/mysql
    chmod 750 /var/log/mysql

    mkdir /tmp/mysqltmp
    chown mysql:mysql /tmp/mysqltmp
    chmod 750 /tmp/mysqltmp

    ******************
    in /etc/my.cnf

    [mysqld]
    log-error=/var/log/mysql/error.log
    tmpdir=/tmp/myslqtmp

    [mysqld safe]
    log-error=/var/log/mysql/safeerror.log
    **************************************************
    **************************************************
    **************************************************

    apachectl [start/stop/restart]
    [shanerd Documents]$

    Commented out PrivateTmp=true -> #PrivateTmp=true in
    /usr/lib/systemd/system/mysqld.service
    /etc/systemd/system/multi-user.target.wants/mysqld.service

  10. #10
    Just Joined!
    Join Date
    Nov 2012
    Posts
    40
    disk size (also I installed flashplayer, hulu movies hooked to a tv monitor while I remote work station as the linux box plays movies on my tv..) I know decadant, but we all have work environments we have to tolerate... hmmmmm.

    [shane@rd Documents]$ df -H
    Filesystem Size Used Avail Use% Mounted on
    rootfs 53G 3.6G 47G 8% /
    devtmpfs 839M 0 839M 0% /dev
    tmpfs 848M 619k 847M 1% /dev/shm
    tmpfs 848M 1.8M 846M 1% /run
    /dev/mapper/vg-lv_root 53G 3.6G 47G 8% /
    tmpfs 848M 0 848M 0% /sys/fs/cgroup
    tmpfs 848M 0 848M 0% /media
    /dev/sda1 508M 98M 385M 21% /boot
    /dev/mapper/vg-lv_home 190G 1.3G 179G 1% /home



    looks clean though as far as disk space.... to hulu or not to hulu.. what do you think of the bugzilla code? start over with newer version of linux? if so which type? think you see where my work is headed.

Page 1 of 2 1 2 LastLast

Posting Permissions

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