SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Could anyone help me with this: Whenever I try to connect to MySQL, I get this:

    Code:
    [root@www /]# safe_mysqld
    Starting mysqld daemon with databases from /var/lib/mysql
    mysqld daemon ended
    [root@www /]# mysql
    ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/m
    ysql.sock' (111)
    [root@www /]# mysqladmin -p ping
    Enter password:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql
    .sock' (111)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex
    ists!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    risul,
    Enter the command: ps aux|grep mysqld
    It seems to me as if you have a mysqld already running and that's why it can't bind or listen on port :3306 or :mysql. Also, when you start safe_mysqld, do it as: safe_mysqld & . That makes it run in the background and not take up the whole terminal.

    So, paste the input of ps aux|grep mysqld and then we'll be able to help you a bit more.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I get:

    Code:
    [root@www admin]# ps aux|grep mysqld
    root      1718  0.0  0.0  1676    0 ?        SW   Dec28   0:00 [safe_mysqld]
    mysql     1736  0.0  1.7 10816  532 ?        SN   Dec28   0:00 /usr/sbin/mysqld
    mysql     1738  0.0  1.7 10816  532 ?        SN   Dec28   0:00 /usr/sbin/mysqld
    mysql     1739  0.0  1.7 10816  532 ?        SN   Dec28   0:00 /usr/sbin/mysqld
    [root@www admin]#

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I their any way to take down the MySQL server and reboot it or something??

    I have installed the .pkg file provided by Cobalt (it's a RaQ3 i'm using)! Do you guys know where this .pkg installs mysql?

  5. #5
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    About the installation of mysql:
    Check /usr/local/mysql, /var/lib/mysql, and /var/mysql. If none of those are the correct mysql locations, do this:
    updatedb
    locate safe_mysqld|less
    And it will tell you where safe_mysqld is. You might get a symlink in /usr/bin but it will also show a real one in /something/mysql/bin/safe_mysqld.

    As for the server startup:
    Run the command:
    kill -9 1718 1736 1738 1739
    And then start the server with:
    safe_mysqld &
    It should work now. If it doesn't, post again and I'll guide you through more steps.

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are an angel man!! Could you please tell which command to use for changing the password from cobalt-mysql to something i want??

    Thanks!

  7. #7
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to the mysqladmin documentation, do this:
    ./mysqladmin password new-password
    I bet it will prompt ya for your old password if you do that.

    Hope this helps...

  8. #8
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is what i get when trying to find mysql on my system:

    [root@www mysql]# locate safe_mysqld
    /usr/bin/safe_mysqld
    [root@www mysql]#

    when i try changing the pwd:

    [root@www mysql]# mysqladmin password blahxxx
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: NO)'

    any other ideas?

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Getting this:

    Code:
    [root@www admin]# mysqladmin password new-password
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: NO)'
    [root@www admin]#

  10. #10
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops, my bad. Here's how to really change your password :P

    ./mysqladmin -u username -p password new-password

    And, for the location of the mysql installation, try this:
    locate pack_isam

    If you installed from source, it will have some pack_isam files in the source directory. But the one you're looking for is one in a different directory. If you can't distinguish the real one, post the results of the locate command and I'll help ya.

  11. #11
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this worked beautifully:



    1. Shut down server (if running)
    The best way to do this is locate the lock file of the running MySQL server
    process. This will be called after your raq's name, not including the
    domain. To find this out look at your prompt or type "cat /etc/HOSTNAME".
    The bit we want is the first bit (before the first '.' in the name!). So for
    example a raq called http://www.abc.com, the lock file we want will be called
    http://www.pid. Now look for the lock file - typical places are
    /usr/local/mysql/data or /usr/local/var. If you cant find it try typing
    "find / -name http://www.pid 2>/dev/null" and see if that finds it.

    If we have located the lock file type "kill `cat /path/to/www.pid`"
    (omitting the double quotes, replacing the file path with whatever it really
    is and leave the ` characters there!!).

    If we cant find the lock file or the last command gives an error try typing
    "p mysql" which should produce a list of 3 or more. Ignore any entries in
    the list that look like "grep mysql". If the list is empty (bar the "grep
    mysql"), mysql is not running. If its not empty, look for the process id of
    the last entry (bar "grep mysql" if its there) in the list (2nd column) and
    type "kill 1234" where 1234 is that process id. Type "p mysql" again to see
    if the list is still there. If it is keep killing the last entry until the
    list is empty - but usually it will be empty after the "first kill"!

    2. Start server by-passing permissions
    Look for the server file name "mysqld". It might be in
    /usr/local/libexec/mysqld or /usr/local/mysql/bin/mysqld. If you have
    trouble finding it try typing "find / -name mysqld 2>/dev/null" which should
    find it! Type "/usr/local/mysql/mysqld --skip-grant-tables &" where
    /usr/local/mysql/mysqld is where you found mysqld.

    3. Connect to MySQL
    Type "mysql -u root mysql" to connect to MySQL.

    4. Change Password
    ** WARNING: This assumes you are using the default security settings and
    have not tweaked them to your own use. If you have or are in doubt please
    read MySQL documentation about this step **

    At the "mysql>" prompt type "update user set Password=PASSWORD('newpwd')
    where User='root';". Leave out the double quotes but leave in the single
    quotes & semi-colon. "newpwd" is the new password you want for root. You
    might want to be a bit more concise and use "update user set
    Password=PASSWORD('newpwd') where User='root' and Host='localhost';".

    Now type "FLUSH PRIVILEGES;" to enforce the new privileges throughout the
    database(s).

    5. Restart MySQL in normal mode again
    Follow the steps in Step 1 to shutdown the MySQL server again. Then type
    "/usr/local/mysql/bin/safe_mysqld &" to start the server back in safe/normal
    mode. You should now be able to use "mysql -u root -p" and provide the new
    password when prompted to connect again!

  12. #12
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by qslack
    Oops, my bad. Here's how to really change your password :P

    ./mysqladmin -u username -p password new-password

    And, for the location of the mysql installation, try this:
    locate pack_isam

    If you installed from source, it will have some pack_isam files in the source directory. But the one you're looking for is one in a different directory. If you can't distinguish the real one, post the results of the locate command and I'll help ya.
    this is wierd:

    [root@www mysql]# locate pack_isam
    [root@www mysql]#

  13. #13
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by qslack
    Oops, my bad. Here's how to really change your password :P

    ./mysqladmin -u username -p password new-password

    And, for the location of the mysql installation, try this:
    locate pack_isam

    If you installed from source, it will have some pack_isam files in the source directory. But the one you're looking for is one in a different directory. If you can't distinguish the real one, post the results of the locate command and I'll help ya.
    Nice man! Everything works perfectly. Now since you have allready helped us a lot one more question. In kevin's article about installing mysql/php in webmasterbase, he rights about adding mysqlgroup, running install_db and lots of other things.. is this necessery when you have used a .pkg file provided by cobalt to install this software?

    The only thing I need to do now is to create databases and give other users/domains permissions??

    Thanks again!

  14. #14
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by teck
    Originally posted by qslack
    Oops, my bad. Here's how to really change your password :P

    ./mysqladmin -u username -p password new-password

    And, for the location of the mysql installation, try this:
    locate pack_isam

    If you installed from source, it will have some pack_isam files in the source directory. But the one you're looking for is one in a different directory. If you can't distinguish the real one, post the results of the locate command and I'll help ya.
    this is wierd:

    [root@www mysql]# locate pack_isam
    [root@www mysql]#
    [root@www admin]# mysqladmin -p variables
    Enter password:
    +----------------------------+---------------------------+
    | Variable_name | Value |
    +----------------------------+---------------------------+
    | back_log | 5 |
    | connect_timeout | 5 |
    | basedir | / |
    | datadir | /var/lib/mysql/ |
    | delayed_insert_limit | 100 |
    | delayed_insert_timeout | 300 |
    | delayed_queue_size | 1000 |
    | join_buffer | 131072 |
    | flush_time | 0 |
    | key_buffer | 8388600 |
    | language | /usr/share/mysql/english/ |
    | log | OFF |
    | log_update | OFF |
    | long_query_time | 10 |
    | low_priority_updates | OFF |
    | max_allowed_packet | 1048576 |
    | max_connections | 100 |
    | max_connect_errors | 10 |
    | max_delayed_insert_threads | 20 |
    | max_join_size | 4294967295 |
    | max_sort_length | 1024 |
    | max_write_lock_count | 4294967295 |
    | net_buffer_length | 16384 |
    | pid_file | /var/lib/mysql/www.pid |
    | port | 3306 |
    | protocol_version | 10 |
    | record_buffer | 131072 |
    | skip_locking | ON |
    | skip_networking | OFF |
    | socket | /var/lib/mysql/mysql.sock |
    | sort_buffer | 2097144 |
    | table_cache | 64 |
    | thread_stack | 65536 |
    | tmp_table_size | 1048576 |
    | tmpdir | /tmp/ |
    | version | 3.22.32 |
    | wait_timeout | 28800 |
    +----------------------------+---------------------------+

  15. #15
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because Cobalt attempts to make everything easy (they generally succeed, although I've never used a Raq myself), you probably don't have to run install_db or anything. I only run a server for myself, so I don't know anything about how to make groups but I'm sure plenty of other Sitepointers would.

    For the person who got no results for locate pack_isam:
    Make sure you did updatedb first as root. cd to the directory with the 'mysql' client application (not the server) and type: ls -Al mysql . It will show something like: mysql -> /usr/lalala/ffff/bin/mysql. The second is the thing you want.


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
  •