Ubuntu Server Guide
Download 1.23 Mb. Pdf ko'rish
|
ubuntu-server-guide (1)
Advanced configuration
Creating a tuned configuration There are a number of parameters that can be adjusted within MySQL’s configuration files that will allow you to improve the performance of the server over time. Many of the parameters can be adjusted with the existing database, however some may affect the data layout and thus need more care to apply. First, if you have existing data, you will need to carry out a mysqldump and reload: mysqldump −−a l l −d a t a b a s e s −−r o u t i n e s −u r o o t −p > ~/ fulldump . s q l This will then prompt you for the root password before creating a copy of the data. It is advisable to make sure there are no other users or processes using the database whilst this takes place. Depending on how much data you’ve got in your database, this may take a while. You won’t see anything on the screen during this process. Once the dump has been completed, shut down MySQL: sudo s e r v i c e mysql s t o p It’s also a good idea to backup the original configuration: sudo r s y n c −avz / e t c / mysql / r o o t / mysql−backup Next, make any desired configuration changes. Then delete and re-initialise the database space and make sure ownership is correct before restarting MySQL: sudo rm − r f / var / l i b / mysql /* sudo mysqld −− i n i t i a l i z e sudo chown −R mysql : / var / l i b / mysql sudo s e r v i c e mysql s t a r t The final step is re-importation of your data by piping your SQL commands to the database. c a t ~/ fulldump . s q l | mysql For large data imports, the ‘Pipe Viewer’ utility can be useful to track import progress. Ignore any ETA times produced by pv, they’re based on the average time taken to handle each row of the file, but the speed of inserting can vary wildly from row to row with mysqldumps: sudo apt i n s t a l l pv pv ~/ fulldump . s q l | mysql Once that is complete all is good to go! 132 Note This is not necessary for all my.cnf changes. Most of the variables you may wish to change to improve performance are adjustable even whilst the server is running. As with anything, make sure to have a good backup copy of config files and data before making changes. Download 1.23 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling