hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Dedicated Server : How to edit my.cnf
Reply

Forum Jump

How to edit my.cnf

Reply Post New Thread In Dedicated Server Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 01-26-2006, 08:41 PM
registercheaper registercheaper is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Posts: 89

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

Reply With Quote


Sponsored Links
  #2  
Old 01-26-2006, 08:53 PM
bithost(NET) bithost(NET) is offline
Too smart for her own good.
 
Join Date: Feb 2004
Location: Your Screen
Posts: 3,998
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.

Reply With Quote
  #3  
Old 01-26-2006, 08:57 PM
bithost(NET) bithost(NET) is offline
Too smart for her own good.
 
Join Date: Feb 2004
Location: Your Screen
Posts: 3,998
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.

Reply With Quote
Sponsored Links
  #4  
Old 01-26-2006, 09:01 PM
registercheaper registercheaper is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Posts: 89
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.
Reply With Quote
  #5  
Old 01-26-2006, 09:07 PM
layer0 layer0 is offline
Performance Specialist
 
Join Date: Dec 2004
Location: New York, NY
Posts: 10,444
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 Lightning fast web hosting since 2005.
The pioneers of optimized application hosting, featuring LiteSpeed Web Server & SSD Storage
Learn how we can make your website load faster, translating to better conversion rates for your business!

Reply With Quote
  #6  
Old 01-27-2006, 05:10 AM
registercheaper registercheaper is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Posts: 89
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.

Reply With Quote
  #7  
Old 01-27-2006, 06:49 AM
k3oni k3oni is offline
WHT 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 ***...

Reply With Quote
  #8  
Old 01-27-2006, 07:13 AM
registercheaper registercheaper is offline
Junior Guru Wannabe
 
Join Date: Jun 2004
Posts: 89
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

Reply With Quote
  #9  
Old 01-27-2006, 07:23 AM
k3oni k3oni is offline
WHT 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!

Reply With Quote
  #10  
Old 01-27-2006, 10:16 AM
bithost(NET) bithost(NET) is offline
Too smart for her own good.
 
Join Date: Feb 2004
Location: Your Screen
Posts: 3,998
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.

Reply With Quote
  #11  
Old 02-09-2006, 05:50 AM
Rain Maker Rain Maker is offline
WHT Addict
 
Join Date: Aug 2002
Posts: 174
I also need to edit my.cnf file.

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

Thanks.

__________________
..

Reply With Quote
  #12  
Old 02-09-2006, 08:21 AM
vecctormedia vecctormedia is offline
Junior Guru Wannabe
 
Join Date: Jan 2006
Location: Europe
Posts: 49
"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

Reply With Quote
  #13  
Old 02-10-2006, 01:28 AM
Defcon|Rich Defcon|Rich is offline
Carpe Diem
 
Join Date: Jul 2003
Location: Connecticut
Posts: 3,038
And that's why companies like Cpanel are rich now


Point and click baby!!

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
WPTouch WordPress Plugin Vulnerability Allows Non-Admins to Take Over Website Web Hosting News 2014-07-14 16:17:19
Open Source Collaboration Provider Open-Xchange Launches OX Spreadsheet Tool: WHD.global 2014 Web Hosting News 2014-04-01 11:18:13
Posterous Shuts Down Today, Here Are Some Alternatives Blog 2013-04-30 17:26:02
Why Federate when you can Differentiate? Webinars 2014-06-10 11:07:26
A Farewell and Thank You Note from Liam Eagle Blog 2013-02-15 16:47:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?