Help Installing Ispconfig please

Discussion in 'Installation/Configuration' started by roe74979, Mar 26, 2013.

  1. roe74979

    roe74979 New Member

    Hello all,

    I am folling this tutorial..http://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3 and I ge to the part that says:.

    Code:
    php -q install.php
    I get to the bottom to

    Code:
    MySQL charset [utf8]: <-- ENTER
    and I get

    Code:
    Unable to connect to the specified MySQL server Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    
    I've done a bit of research before posting here, and it says to mess with the .cnf file and change the part about client. but that didnt work either. so any help that I can get would be appreciated becuase I need ISPConfig up and running soon.

    thanks
     
  2. researcher7

    researcher7 New Member

    Is mysql running?

    What is the output of
    Code:
    ps aux | grep mysql | grep -v grep
    
    Did you set your mysql root password before you started install?
    If not, you need to do so.
     
  3. roe74979

    roe74979 New Member

    Thanks for the reply,

    when I put in the code you gave me, nothing happens.

    I did put in a root password.

    I honestly dont know if MYSQL is installed. still new to the Linix world of OS. Anyway to check to see if its installed?

    thanks
     
  4. researcher7

    researcher7 New Member

    Thanks for the update.
    OK, we have 2 possibilities, MySQL is installed but not running, or it was not installed.

    If you have followed step 12 as specified in the article, and did not see any errors, then it could be installed but not running.
    In this case, run the following.

    Code:
    /etc/init.d/mysqld start
    You should see something like.

    mysql start/running, process xxxx

    You can change/specify root password by issuing the following:

    The service would be stopped and you will be prompted to enter an new root password.


    If you get an error, file not found, ..etc when running /etc/init.d/mysqld start then we have to assume that MySQL was not installed, or was removed.

    In that case, do the following.

    When asked to enter root password, choose and enter one.

    Now you can use that root password when you install ISP Config.

    If you see other issues, please post the output as you see it in your ssh window.
     
  5. roe74979

    roe74979 New Member

    thank you for your response,

    I had to follow cod 2, because I did not do step 12 of the instructions because I just wanted ISPconfig, and not the rest.

    so I installed MYSQL as instructed via your code. now I get to the same step

    Code:
    MySQL charset [utf8]: <-- ENTER
    and i'm now getting this error:

    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2)
    ERROR: Unable to load SQL-Dump into database table.
    
    Edit: Could this have anything to do with the fact that i'm doing this remotely from school to my home PC?

    thanks
     
    Last edited: Mar 26, 2013
  6. researcher7

    researcher7 New Member

    It should not have anything to do with your connection, once you are connected successfully via ssh, your commands are running on the server you are connected to.

    ISP Config configuration from that link needs mysql installed and running.
    At this point it is either not running or needs to listen on all IPS.
    Edit your /etc/mysql/my.cnf and comment out the following line.
    bind-address = 127.0.0.1

    Something like

    Code:
    nano /etc/mysql/my.cnf
    And then make sure
    Code:
    #bind-address           = 127.0.0.1
    Use Ctrl + O and then Enter to save, Ctrl + x to exit.

    Restart mysql

    Code:
    /etc/init.d/mysql restart
    Check if it is running/listening.

    Code:
    netstat -tap | grep mysql
    Then
    Code:
    ps aux | grep mysql | grep -v grep
    Both should not return empty responses. If they did, then mysql is not running and we need to find out why.
     
  7. roe74979

    roe74979 New Member

    Thanks for the response,

    Ok, so I edited the my.cnf wilfe and there was already a

    Code:
    #bind-address           = 127.0.0.1
    ,but there wasn't a #, so I added one before "bind"

    I went to restart using

    Code:
    /etc/init.d/mysql restart
    and it gave me this

    Code:
    student@student-desktop:~$ /etc/init.d/mysql restart
    Rather than invoking init scripts through /etc/init.d, use the service(8)
    utility, e.g. service mysql restart
    
    Since the script you are attempting to invoke has been converted to an
    Upstart job, you may also use the stop(8) and then start(8) utilities,
    e.g. stop mysql ; start mysql. The restart(8) utility is also available.
    stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.72" (uid=1000 pid=10598 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    
    I continued on with the rest of the codes, just incase they mean something.

    Code:
    (Not all processes could be identified, non-owned process info
     will not be shown, you would have to be root to see it all.)
    tcp        0      0 localhost:mysql         *:*                     LISTEN      -               
    
    Code:
    student@student-desktop:~$ ps aux | grep mysql | grep -v grep
    mysql     7225  0.1  0.5 552100 44492 ?        Ssl  10:16   0:03 /usr/sbin/mysqld
    
     
    Last edited: Mar 26, 2013
  8. researcher7

    researcher7 New Member

    So mysql is running. That is good.
    Now since it complained about restarting via the old /etc/init.d script, go ahead and restart it.

    Code:
    service mysql restart
    Now make sure that you can connect to mysql as root.

    Code:
    mysql -u root -p
    If you have specified a root password when installing mysql, enter it now, and should be connected to mysql and your prompt should be looking like this:

    mysql>

    Type:
    Code:
    exit
    And then Enter, and you should be disconnected from myql.

    Now you have verified that mysql is running and your mysql root password works, run the install script again for ISP Config.

    Note: Password for mysql root is not necessarily the same password for your Linux root, and not recommended to be the same. Make sure it is a strong password.

    If you are getting errors like
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    After you provide the password when you try to connect to mysql, please let me know, at that point, we need to reset/specify your mysql root password.
     
  9. roe74979

    roe74979 New Member

    after running:

    Code:
    mysql -u root -p
    I got this error:

    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2)
    
     
  10. researcher7

    researcher7 New Member

    OK, at this point, we have established that mysql is running, but the client cannot connect to it.

    Few things to check.

    Does /tmp/mysql.sock exist?

    To find out run:

    Code:
    ls -1lah /tmp/mysql.sock
    If you see an error message, then for some reason, the file was removed.

    Run,

    Code:
    touch /tmp/mysql.sock
    Restart mysql

    Code:
    service mysql restart
    try connecting again.

    If you still get the same error message, then we need to verify that the socket file location specified in your /etc/my.cnf (depending on your configuration, that file may also exist at /etc/mysql/my.cnf) is the same for both the service and the client.

    Code:
    nano /etc/my.cnf
    Or
    nano /etc/mysql/my.cnf
    
    Check [mysqld] section.

    You should find
    Code:
    socket      = /tmp/mysqld.sock
    Check the [client] section, make sure the same exists.

    If not, change according.

    The general rule is the client section to match what the [mysqld] section has for the socket file location, so if it is
    /tmp/mysqld.sock, then client section should have /tmp/mysqld.sock
    If it is something else, like /var/run/mysqld/mysqld.sock then client should have the same.

    Ctrl + o and then Enter to save.
    Ctrl + x to exist nano.

    If you have made any changes, restart mysql, and try again.
     
    Last edited: Mar 26, 2013
  11. roe74979

    roe74979 New Member

    Code:
    ls: cannot access /tmp/mysql.sock: No such file or directory
    after running

    Code:
    touch /tmp/mysql.sock
    nothing happened, a new line came up to type in. not sure if that's supposed happen or not

    I then ran

    Code:
    service mysql restart
    and getting this

    Code:
    stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.78" (uid=1000 pid=11023 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    start: Rejected send message, 1 matched rules; type="method_call", sender=":1.79" (uid=1000 pid=11020 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
    
    I stopped there but I did go to the location to see if I could see it. It opened and says this

    Code:
    socket		= /var/run/mysqld/mysqld.sock
    before changing anything, you want me to change it to

    Code:
    socket      = /tmp/mysqld.sock
    ? just making sure before doing so... thanks
     
  12. researcher7

    researcher7 New Member

    As mentioned in the previous reply.
    The general rule is the [client] section to match what the [mysqld] section has for the socket file location, so if [mysqld] shows

    socket = /tmp/mysqld.sock,

    then [client] section should have
    /tmp/mysqld.sock

    If [mysqld] has something else, like socket = /var/run/mysqld/mysqld.sock then [client] should have the same.

    Note: Make sure to back up your my.cnf file before applying any changes.

    Code:
    cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
    Or

    Code:
    cp /etc/my.cnf /etc/my.cnf.bak
     
    Last edited: Mar 26, 2013
  13. roe74979

    roe74979 New Member

    ok sorry, missed the part about client needing same thing. I did double check, and they are the same.
     
  14. researcher7

    researcher7 New Member

    So the client and the server both showing the same location for the socket file?

    In your my.cnf, you should see.

    Code:
    [mysqld]
    socket = /tmp/mysqld.sock
    
    .....
    
    [client]
    socket      = /tmp/mysqld.sock
    Is this what you see right now?

    Also, please check if you are using mysql for anything else on your server.
     
  15. roe74979

    roe74979 New Member

    yes they both say the same thing. posting what they say to make sure i'm not missing something

    Code:
    [client]
    port		= 3306
    socket 		= /tmp/mysqld.sock
    
    [mysqld]
    #
    # * Basic Settings
    #
    user		= mysql
    pid-file	= /var/run/mysqld/mysqld.pid
    socket 		= /tmp/mysqld.sock
    as for checking that MYSQL is used for anything else, sorry... I don't know how to do that.
     
  16. researcher7

    researcher7 New Member

    Thanks for the update.

    OK. That looks good but you still can't connect to the server from your local client.
    The reason I asked for mysql being used for other applications, is that you may need, as a last resort to remove and then re-install mysql and mysql client.

    Before going that far, let's see what your logs show.
    Is logging enabled by any chance in your config?

    Check by running.

    Code:
    grep -i "log_" /etc/mysql/my.cnf
    Look for:
    general_log_file
    log_error

    Please post what are the values and if they are enabled (uncommented) or not.
     
  17. roe74979

    roe74979 New Member

    Thanks for the response. This is what it spit out.


    Code:
    #general_log_file        = /var/log/mysql/mysql.log
    log_error = /var/log/mysql/error.log
     
  18. researcher7

    researcher7 New Member

    That should be enough to get us some info.
    Please provide the output of:

    Code:
    tail -30 /var/log/mysql/error.log
    Thanks.
     
  19. roe74979

    roe74979 New Member

    Thanks,

    its a lot of info.

    Code:
    student@student-desktop:~$ tail -30 /var/log/mysql/error.log
    130326 10:16:36 InnoDB: Compressed tables use zlib 1.2.7
    130326 10:16:36 InnoDB: Using Linux native AIO
    130326 10:16:36 InnoDB: Initializing buffer pool, size = 128.0M
    130326 10:16:36 InnoDB: Completed initialization of buffer pool
    130326 10:16:36 InnoDB: highest supported file format is Barracuda.
    130326 10:16:37  InnoDB: Waiting for the background threads to start
    130326 10:16:38 InnoDB: 1.1.8 started; log sequence number 1595675
    ERROR: 1050  Table 'plugin' already exists
    130326 10:16:38 [ERROR] Aborting
    
    130326 10:16:38  InnoDB: Starting shutdown...
    130326 10:16:38  InnoDB: Shutdown completed; log sequence number 1595675
    130326 10:16:38 [Note] /usr/sbin/mysqld: Shutdown complete
    
    130326 10:16:39 [Note] Plugin 'FEDERATED' is disabled.
    130326 10:16:39 InnoDB: The InnoDB memory heap is disabled
    130326 10:16:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    130326 10:16:39 InnoDB: Compressed tables use zlib 1.2.7
    130326 10:16:39 InnoDB: Using Linux native AIO
    130326 10:16:39 InnoDB: Initializing buffer pool, size = 128.0M
    130326 10:16:39 InnoDB: Completed initialization of buffer pool
    130326 10:16:39 InnoDB: highest supported file format is Barracuda.
    130326 10:16:39  InnoDB: Waiting for the background threads to start
    130326 10:16:40 InnoDB: 1.1.8 started; log sequence number 1595675
    130326 10:16:40 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    130326 10:16:40 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
    130326 10:16:40 [Note] Server socket created on IP: '127.0.0.1'.
    130326 10:16:40 [Note] Event Scheduler: Loaded 0 events
    130326 10:16:40 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.5.29-0ubuntu0.12.10.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
     
  20. researcher7

    researcher7 New Member

    There's the problem right there.

    Your mysql client is looking for /tmp/mysql.sock while the actual file exist at
    /var/run/mysqld/mysqld.sock

    You need to modify your my.cnf (backup the file first) and change the [client] section to

    Code:
    socket = /var/lib/mysql/mysql.sock
    Save, restart mysql server and then try to connect again.
     

Share This Page