Introduction to MySQL maintenance and Practical Application Design Notes

Source: Internet
Author: User

The following articles mainly describe how to correctly use the MySQL (the best combination with PHP) service, and the related content of MySQL maintenance and actual application design notes, this article focuses on the following several practical considerations for MySQL (the best combination with PHP) service planning and design.

1. The installation/configuration versatility of MySQL (the best combination with PHP) service;

2. Easy system upgrade and data migration;

3. fast backup and System Recovery;

Plan the MySQL (best combination with PHP) Server

In order to maintain MySQL in the future, upgrade the backup convenience and data security, it is best to install MySQL (the best combination with PHP) program files and data on "different hardware" separately.

/

/Usr <= operating system }=> Hard Disk 1

/Home/MySQL (the best combination with PHP) <= MySQL (the best combination with PHP) Application

...

/Data/app_1/<= Application data and script} => Hard Disk 2

/Data/app_2/

/Data/app_3/

Install MySQL (the best combination with PHP) and start the service:

MySQL (the best combination with PHP) generally uses the current STABLE version. Do not use the -- with-charset = option whenever possible, I feel that with-charset is only useful in alphabetical order. These options can cause a lot of trouble for data migration.

Configure -- prefix =/home/MySQL (the best combination with PHP)

Make

Make install

Service start and stop

1. Copy the default MySQL (the best combination of maintenance and PHP)/var/MySQL (the best combination with PHP) to the/data/app_1/directory.

2 MySQL (the best combination with PHP) d startup script:

Start_MySQL (the best combination with PHP). sh

 
 
  1. #!/bin/sh  
  2. rundir=`dirname "$0"`  
  3. echo "$rundir" 

/Home/MySQL (the best combination with PHP)/bin/safe_MySQL (the best combination with PHP) d -- user = MySQL (the best combination with PHP) -- pid-file = "$ rundir"/MySQL (the best combination with PHP ). pid -- datadir = "$ rundir"/var "$ @"\

-O max_connections = 500-O wait_timeout = 600-O key_buffer = 32 M -- port = 3402 -- socket = "$ rundir"/MySQL (the best combination with PHP). sock &

Note:

-- Pid-file = "$ rundir"/MySQL (the best combination with PHP ). pid -- socket = "$ rundir"/MySQL (the best combination with PHP ). sock -- datadir = "$ rundir"/var

The purpose is to put the corresponding data and temporary application files together;

-O is generally followed by the global variable optimization Parameter for server startup, and sometimes needs to be adjusted according to the specific application;

-- Port: different applications use PORT parameters to distribute to different services. The number of connections that a service can provide is generally the main bottleneck of MySQL maintenance (the best combination with PHP) services;

After modifying different services to different ports, add the following to the rc. local file:

/Data/app_1/start_MySQL (the best combination with PHP). sh

/Data/app_2/start_MySQL (the best combination with PHP). sh

/Data/app_3/start_MySQL (the best combination with PHP). sh

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.