The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with mysql

Discussion in 'Database Discussions' started by dimdimin, Nov 14, 2011.

  1. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello
    I have got a very strange problem with mysql: I cannot make any changes to the my.cnf file.
    Server works only with the default settings and the empty file my.cnf.
    When I make any changes to this file and restart the server mysql, all the databases stop working. Could you please tell me the reason of this problem?
     
  2. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    here is an example
    I added to the my.cnf file
    [mysqld]
    max_allowed_packet = 16M
    saved the file and restart the server
    After starting the server at all sites get the error - no database available
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Could you check the error log at /var/lib/mysql/hostname.err where hostname.err is the fully qualified hostname of the machine. You can always run an ls to check the file's name:

    Code:
    cd /var/lib/mysql
    ls *.err
    Once you have the name, simply tail the log after you restart MySQL with the content you place into /etc/my.cnf location:

    Code:
    tail -f /var/lib/mysql/hostname.err
    Please post the exact error message(s) you are receiving upon doing this.
     
  4. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Code:
    111115 17:53:30 [Note] /usr/sbin/mysqld: Normal shutdown
    
    111115 17:53:30 [Note] Event Scheduler: Purging the queue. 0 events
    111115 17:53:30  InnoDB: Starting shutdown...
    111115 17:53:35  InnoDB: Shutdown completed; log sequence number 0 542300292
    111115 17:53:35 [Note] /usr/sbin/mysqld: Shutdown complete
    
    
    111115 17:53:35 mysqld_safe mysqld from pid file /var/lib/mysql/[COLOR=#333333][FONT=monospace]hostname[/FONT][/COLOR].pid ended
    111115 17:53:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    111115 17:53:36 [Note] Plugin 'FEDERATED' is disabled.
    111115 17:53:36  InnoDB: Initializing buffer pool, size = 8.0M
    111115 17:53:36  InnoDB: Completed initialization of buffer pool
    111115 17:53:36  InnoDB: Started; log sequence number 0 542300292
    111115 17:53:36 [ERROR] /usr/sbin/mysqld: unknown option '--tail -f /var/lib/mysql/[COLOR=#333333][FONT=monospace]hostname.err[/FONT][/COLOR]'
    111115 17:53:36 [ERROR] Aborting
    
    
    111115 17:53:36  InnoDB: Starting shutdown...
    111115 17:53:41  InnoDB: Shutdown completed; log sequence number 0 542300292
    111115 17:53:41 [Note] /usr/sbin/mysqld: Shutdown complete
    
    
    111115 17:53:41 mysqld_safe mysqld from pid file /var/lib/mysql/[COLOR=#333333][FONT=monospace]hostname[/FONT][/COLOR].pid ended
    
    
    

    This is what I saw in this file
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    How precisely are you starting up MySQL on the server? The error is even due to a tail for the shutdown, which is very strange:

    Are you passing flags during the restart of MySQL?

    How about trying the following. Move the existing /etc/my.cnf file entirely. Then create a new one:

    Code:
    touch /etc/my.cnf
    Run these two commands:

    Code:
    echo "[mysqld]" >> /etc/my.cnf
    echo "max_allowed_packet = 16M" >> /etc/my.cnf
    Then restart MySQL again:

    Code:
    /etc/init.d/mysql restart
    At that point, just tail the last 50 lines of the log again:

    Code:
    tail -50 /var/lib/mysql/hostname.err
    Also, can you see what is in /root/.my.cnf file and provide those contents? Please *** out the password for MySQL if you post the contents.
     
  6. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Main >> Restart Services >> SQL Server (MySQL)
     
  7. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Code:
    111115 18:40:44 [Note] /usr/sbin/mysqld: Normal shutdown
    
    111115 18:40:44 [Note] Event Scheduler: Purging the queue. 0 events
    111115 18:40:44  InnoDB: Starting shutdown...
    111115 18:40:48  InnoDB: Shutdown completed; log sequence number 0 542684207
    111115 18:40:48 [Note] /usr/sbin/mysqld: Shutdown complete
    
    111115 18:40:48 mysqld_safe mysqld from pid file /var/lib/mysql/server1.hostproff.ru.pid ended
    111115 18:40:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    111115 18:40:49 [Note] Plugin 'FEDERATED' is disabled.
    111115 18:40:49  InnoDB: Initializing buffer pool, size = 8.0M
    111115 18:40:49  InnoDB: Completed initialization of buffer pool
    111115 18:40:49  InnoDB: Started; log sequence number 0 542684207
    111115 18:40:49 [Note] Event Scheduler: Loaded 0 events
    111115 18:40:49 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.1.56'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
    
    After you create a new file on your recommendation, server is running
     
  8. dimdimin

    dimdimin Member

    Joined:
    Oct 15, 2011
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you very much for your help
     
Loading...

Share This Page