{"id":692,"date":"2014-12-29T12:12:32","date_gmt":"2014-12-29T19:12:32","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=692"},"modified":"2014-12-29T12:12:32","modified_gmt":"2014-12-29T19:12:32","slug":"how-to-edit-the-mysql-my-cnf-file","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2014\/12\/29\/how-to-edit-the-mysql-my-cnf-file\/","title":{"rendered":"How to edit the MySQL my.cnf file"},"content":{"rendered":"<p>VPS and Dedicated server customers with <a href=\"http:\/\/www.inmotionhosting.com\/support\/website\/general-server-setup\/root-access-faq\" target=\"_blank\" rel=\"noopener\">root access<\/a> can change their MySQL settings in the <strong>my.cnf<\/strong> file. To do this, you simply log in the server and edit the my.cnf file using Nano. This article will explain the steps to view and edit your my.cnf file.<\/p>\n<h2>How to view MySQL settings in the my.cnf file<\/h2>\n<ol class=\"article_list\">\n<li><a title=\"Click here for info\" href=\"http:\/\/www.inmotionhosting.com\/support\/website\/general-server-setup\/how-to-login-ssh\" target=\"_blank\" rel=\"noopener\"><strong>Login to your server via SSH<\/strong><\/a><\/li>\n<li>To view the MySQL my.cnf settings <strong>type the following<\/strong>:\n<pre>cat \/etc\/my.cnf<\/pre>\n<div><\/div>\n<p><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-1-cat.gif\"><img decoding=\"async\" title=\"Viewing the my.cnf with teh cat command\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-1-cat.gif\" alt=\"edit-my-cnf-1-cat\" width=\"100\" \/><\/a>The contents of the my.cnf file will display similar to the snapshot to the right.<\/li>\n<\/ol>\n<h2>Editing the MySQL my.cnf file<\/h2>\n<ol class=\"article_list\">\n<li><a title=\"Click here for info\" href=\"http:\/\/www.inmotionhosting.com\/support\/website\/general-server-setup\/how-to-login-ssh\" target=\"_blank\" rel=\"noopener\"><strong>Login to your server via SSH<\/strong><\/a><\/li>\n<li><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-2-nano.gif\"><img decoding=\"async\" title=\"Using nano in shell\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-2-nano.gif\" alt=\"image-moodle\" width=\"100\" \/><\/a>To edit the MySQL settings with nano <strong>type the following<\/strong>:\n<pre>nano \/etc\/my.cnf<\/pre>\n<p class=\"alert\"><strong>Note!<\/strong> There are several editors you can use in shell. Nano, Vim, or Emacs. This article will focus only on Nano.<\/p>\n<\/li>\n<li><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-3-nano-view.gif\"><img decoding=\"async\" title=\"Click here to view the larger image\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-3-nano-view.gif\" alt=\"Nano the my.cnf in shell\" width=\"100\" \/><\/a><strong>Find the line to edit. <\/strong>For example, if you want to edit the max_connections, find the following line.\n<pre>max_connections=100<\/pre>\n<p><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-4-change.gif\"><img decoding=\"async\" title=\"Click here to view the larger image\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-4-change.gif\" alt=\"Changing the my.cnf with nano\" width=\"100\" \/><\/a>To increase the max_connections to 110 change it to the following.<\/p>\n<pre>max_connections=110<\/pre>\n<\/li>\n<li><strong>Enter Ctrl + O<\/strong> to &#8220;<em>WriteOut<\/em>&#8221; or save the settings.<\/li>\n<li>Then <strong>Ctrl + X to exit<\/strong>.<\/li>\n<li><strong>Restart MySQL <\/strong>by typing the following.\n<pre>service mysql restart<\/pre>\n<p>Now the max_connections is increased to 110 instead of 100.<\/li>\n<\/ol>\n<h2>Viewing the MySQL variables through shell.<\/h2>\n<ol class=\"article_list\">\n<li><a title=\"Click here for info\" href=\"http:\/\/www.inmotionhosting.com\/support\/website\/general-server-setup\/how-to-login-ssh\" target=\"_blank\" rel=\"noopener\"><strong>Login to your server via SSH<\/strong><\/a><\/li>\n<li><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-5-variables.gif\"><img decoding=\"async\" title=\"Click here to view the larger image\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-5-variables.gif\" alt=\"Viewing the MySQL variables\" width=\"100\" \/><\/a>Type the following command.\n<pre>mysqladmin variables<\/pre>\n<p>The variables will display similar to the snapshot to the right.<\/li>\n<\/ol>\n<h2>Viewing MySQL variables in PhpMyAdmin<\/h2>\n<ol class=\"article_list\">\n<li><strong>Log into your <a title=\"Click here for info\" href=\"http:\/\/www.inmotionhosting.com\/support\/website\/cpanel\/how-do-i-manage-a-mysql-database-in-phpmyadmin-in-my-control-panel-cpanel\" target=\"_blank\" rel=\"noopener\">phpMyAdmin<\/a><\/strong><\/li>\n<li><a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-6-phpmyadmmin-variables.gif\"><img decoding=\"async\" title=\"Click here to view the larger image\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-6-phpmyadmmin-variables.gif\" alt=\"Click variables tab in PhpMyAdmin\" width=\"100\" \/><\/a><strong>Click the Variables tab<\/strong> at the top right.<br \/>\n<a class=\"std_ss\" href=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-7-mysql-variables.gif\"><img decoding=\"async\" title=\"Click here to view the larger image\" src=\"http:\/\/cdn.inmotionhosting.com\/support\/images\/stories\/website\/server-usage\/edit-mysql-my-cnf\/edit-my-cnf-7-mysql-variables.gif\" alt=\"PhpMyAdmin list of MySQL variables\" width=\"100\" \/><\/a>PhpMyAdmin will list all the variables and there settings on your server..<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VPS and Dedicated server customers with root access can change their MySQL settings in the my.cnf file. To do this, you simply log in the&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-692","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=692"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/692\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}