Results 1 to 13 of 13
  1. #1

    How to edit my.cnf

    Can someone please give me step by step details on downloading the my.cnf file.
    I dont need any values. What I need is how to get the file on my computer so I can edit it and then upload it again. I see a lot of sites offering info on how to configure the values within the file...but non tell you how to download the file. Thats like telling me what type of seats I need in my car without telling me how to open the doors! When I login to my site via SSH I can see the file...but don't know how to get it downloaded on my computer to edit it.

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    Your Screen
    Posts
    3,999
    It is not a file that you download and then upload again. Root-level files get changed via SSH.

    There are two editors that are pre-installed on your server that you can use while you are SSH'ed in. They are called "nano" and "vi". Of the two, nano will be easier to use, because its key combinations (menu) are provided right on the screen as you work.

    To edit a file, first make a back-up.

    cp /etc/my.cnf /etc/my.cnf.old

    Now open it in nano:

    nano /etc/my.cnf

    Use the arrows to navigate around. Or:
    • CTRL-W brings up a search box, type in the value you are looking for and hit enter.
    • CTRL-V is page down
    • CTRL-Y is page up
    • CTRL-K deletes the line the cursor is on
    • CTRL-X to exit... if you want to save the changes you have made, hit Y. If you don't want to save your changes (like if you made a dastardly mistake, which I do often) hit N. You can always go back into nano again and re-try at making the changes correctly.


    Once you are done,

    /etc/rc.d/init.d/mysql restart

    Your changes will now take effect.

    Bailey
    Let's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.

  3. #3
    Join Date
    Feb 2004
    Location
    Your Screen
    Posts
    3,999
    Oh... if through all of this you have completely broken MySQL, just restore my.cnf using your handy backup:

    cp /etc/my.cnf.old /etc/my.cnf

    The server will ask you if you want to overwrite the existing copy of /etc/my.cnf? y for yes.

    Then type,

    /etc/rc.d/init.d/mysql restart

    and MySQL will be happily restored to its pre-edited settings again.

    Bailey
    Let's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.

  4. #4
    Thank you very much

    After doing the changes can I also do a mysql restart with my whm to apply the changes?...it's much easier for me.
    Last edited by registercheaper; 01-26-2006 at 09:06 PM.

  5. #5
    Join Date
    Dec 2004
    Location
    New York, NY
    Posts
    10,710
    Quote Originally Posted by registercheaper
    Thank you very much

    After doing the changes can I also do a mysql restart with my whm to apply the changes?...it's much easier for me.
    You may do that too yes, but there is really no harm in doing it in SSH.
    MediaLayer, LLC - www.medialayer.com Learn how we can make your website load faster, translating to better conversion rates for your business!
    The pioneers of optimized web hosting, featuring LiteSpeed Web Server & SSD Storage - Celebrating 10 Years in Business

  6. #6
    Once I find the folder how do I copy and paste the contents? I have seen others copy and paste the my.cnf file on other threads.

  7. #7
    Join Date
    Jan 2006
    Location
    Somewhere in USA
    Posts
    110

    Copy and paste!

    Hey there... Copy and paste it's easy...depends from where do you want to copy...if you have found on the web a configuration for mysql...you can easy open the my.cnf file with nano..or pico or vim...and delete all that is inside the my.cnf file and then go and copy the settings and go into your shell again and right-click, and this should be all...or of course right-click and paste...depends what shell are you using...

    I hope this is what you wanted to know...
    If not give a reply and i will try to resend you the answer you are looking for...


    Hope this will help you...

    Go and paste that ***...

  8. #8
    Thanks for your reply,
    Im using nano. I would like to copy my.cnf file and show it to someone. When I hit the copy command it does not copy. I have seen numerous postings with people displaying their my.cnf files of other log files and I just wanted to know how to copy and paste my own logs files for others to examine.

    Example: how did this person post their file
    http://www.webhostingtalk.com/showth...ghlight=my.cnf

  9. #9
    Join Date
    Jan 2006
    Location
    Somewhere in USA
    Posts
    110
    On linux shell , the copy comand may differ, so depending on your SSh client, you could try to "nano my.cnf" and than to select the with the mouse what it is in there...and go on your pc and click paste into a notepad file...

    In the most cases selecting under linux shells will automaticly mean Copy...

    Try this and let us know...Also if it is not working try to tell us what ssh client are you using..


    Bye!

  10. #10
    Join Date
    Feb 2004
    Location
    Your Screen
    Posts
    3,999
    You can print out the contents of my.cnf by typing, in SSH,

    cat /etc/my.cnf

    Then you are not opening the file and risking making changes or deleting part of it. This is just an uneditable printout of the file.

    For me, I just scroll up in the terminal window, select the text I want to copy (like with any web browser? click-drag the mouse?) and hit ctrl-c to copy. Then I paste it into the forum window, text editor, whatever.

    Bailey
    Let's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.

  11. #11
    I also need to edit my.cnf file.

    How do I know if I have nano, pico or vi installed on my server?

    Thanks.
    ..

  12. #12
    Join Date
    Jan 2006
    Location
    Europe
    Posts
    50
    "vi" and "ee" is default editors for FreeBSD, on linux you can try to use pico or something like that. On freebsd nano can be installed from ports collection or via pkg_add command.

    from ports
    Code:
    cd /
    
    cd /usr/ports/editors/nano 
    
    make istall clean
    
    after that just tipe "rehash"
    
    also You can use "pkg_add -r nano"
    
    firenic# pkg_add -r nano
    Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5.4-release/Latest/nano.tbz...
    
    after that just rehash :)
    cheers

  13. #13
    Join Date
    Jul 2003
    Location
    Connecticut
    Posts
    3,038
    And that's why companies like Cpanel are rich now


    Point and click baby!!

Posting Permissions

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