Results 1 to 13 of 13
Thread: How to edit my.cnf
-
01-26-2006, 08:41 PM #1Junior Guru Wannabe
- Join Date
- Jun 2004
- Posts
- 99
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
-
01-26-2006, 08:53 PM #2Too smart for her own good.
- 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.
BaileyLet's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.
-
01-26-2006, 08:57 PM #3Too smart for her own good.
- 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.
BaileyLet's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.
-
01-26-2006, 09:01 PM #4Junior Guru Wannabe
- Join Date
- Jun 2004
- Posts
- 99
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.
-
01-26-2006, 09:07 PM #5Eternal Member
- Join Date
- Dec 2004
- Location
- New York, NY
- Posts
- 10,710
Originally Posted by registercheaperMediaLayer, 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
-
01-27-2006, 05:10 AM #6Junior Guru Wannabe
- Join Date
- Jun 2004
- Posts
- 99
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.
-
01-27-2006, 06:49 AM #7WHT Addict
- 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 ***...
-
01-27-2006, 07:13 AM #8Junior Guru Wannabe
- Join Date
- Jun 2004
- Posts
- 99
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
-
01-27-2006, 07:23 AM #9WHT Addict
- 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!
-
01-27-2006, 10:16 AM #10Too smart for her own good.
- 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.
BaileyLet's Connect on Twitter! @thatsmsgeek2u || Fighting mediocrity one thread at a time.
-
02-09-2006, 05:50 AM #11Junior Guru
- Join Date
- Aug 2002
- Posts
- 175
I also need to edit my.cnf file.
How do I know if I have nano, pico or vi installed on my server?
Thanks...
-
02-09-2006, 08:21 AM #12Junior Guru Wannabe
- 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 :)
-
02-10-2006, 01:28 AM #13Carpe Diem
- Join Date
- Jul 2003
- Location
- Connecticut
- Posts
- 3,038
And that's why companies like Cpanel are rich now
Point and click baby!!