Home Database Mysql Tutorial MySQL维护与实际应用的设计笔记简介

MySQL维护与实际应用的设计笔记简介

Jun 07, 2016 pm 04:09 PM
mysql actual article use notes Introduction maintain design

以下的文章主要讲述是正确使用MySQL(和PHP搭配之最佳组合)服务的实际经验汇总,以及MySQL维护与其实际应用设计笔记的相关内容描述,此文章主要下面的几个实际方面考虑的MySQL(和PHP搭配之最佳组合)服务规划设计。 1 MySQL(和PHP搭配之最佳组合)服务的安装/配

以下的文章主要讲述是正确使用MySQL(和PHP搭配之最佳组合)服务的实际经验汇总,以及MySQL维护与其实际应用设计笔记的相关内容描述,此文章主要下面的几个实际方面考虑的MySQL(和PHP搭配之最佳组合)服务规划设计。

1 MySQL(和PHP搭配之最佳组合)服务的安装/配置的通用性;

2 系统的升级和数据迁移方便性;

3 备份和系统快速恢复;

MySQL(和PHP搭配之最佳组合)服务器的规划

为了以后MySQL维护,升级备份的方便和数据的安全性,最好将MySQL(和PHP搭配之最佳组合)程序文件和数据分别安装在“不同的硬件”上。

/

/usr 硬盘1

/home/MySQL(和PHP搭配之最佳组合)

...

/data/app_1/ 硬盘2

/data/app_2/

/data/app_3/

MySQL(和PHP搭配之最佳组合)服务的安装和服务的启动:

MySQL(和PHP搭配之最佳组合)一般使用当前STABLE的版本,尽量不使用--with-charset=选项,我感觉with-charset只在按字母排序的时候才有用,这些选项会对数据的迁移带来很多麻烦。

configure --prefix=/home/MySQL(和PHP搭配之最佳组合)

make

make install

服务的启动和停止

1 复制缺省的MySQL(维护和PHP搭配之最佳组合)/var/MySQL(和PHP搭配之最佳组合)到 /data/app_1/目录下

2 MySQL(和PHP搭配之最佳组合)D的启动脚本:

start_MySQL(和PHP搭配之最佳组合).sh

<ol class="dp-xml">
<li class="alt"><span><span>#!/bin/sh  </span></span></li>
<li>
<span class="attribute">rundir</span><span>=`dirname "$0"`  </span>
</li>
<li class="alt"><span>echo "$rundir" </span></li>
</ol>
Copy after login

/home/MySQL(和PHP搭配之最佳组合)/bin/safe_MySQL(和PHP搭配之最佳组合)d --user=MySQL(和PHP搭配之最佳组合) --pid-file="$rundir"/MySQL(和PHP搭配之最佳组合).pid --datadir="$rundir"/var "$@"\

-O max_connections=500 -O wait_timeout=600 -O key_buffer=32M --port=3402 --socket="$rundir"/MySQL(和PHP搭配之最佳组合).sock &

注释:

--pid-file="$rundir"/MySQL(和PHP搭配之最佳组合).pid --socket="$rundir"/MySQL(和PHP搭配之最佳组合).sock --datadir="$rundir"/var

目的都是将相应数据和应用临时文件放在一起;

-O 后面一般是服务器启动全局变量优化参数,有时候需要根据具体应用调整;

--port: 不同的应用使用PORT参数分布到不同的服务上去,一个服务可以提供的连接数一般是MySQL维护(和PHP搭配之最佳组合)服务的主要瓶颈;

修改不同的服务到不同的端口后,在rc.local文件中加入:

/data/app_1/start_MySQL(和PHP搭配之最佳组合).sh

/data/app_2/start_MySQL(和PHP搭配之最佳组合).sh

/data/app_3/start_MySQL(和PHP搭配之最佳组合).sh


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

Honor Magic V3 debuts AI defocus eye protection technology: effectively alleviates the development of myopia Honor Magic V3 debuts AI defocus eye protection technology: effectively alleviates the development of myopia Jul 18, 2024 am 09:27 AM

According to news on July 12, the Honor Magic V3 series was officially released today, equipped with the new Honor Vision Soothing Oasis eye protection screen. While the screen itself has high specifications and high quality, it also pioneered the introduction of AI active eye protection technology. It is reported that the traditional way to alleviate myopia is "myopia glasses". The power of myopia glasses is evenly distributed to ensure that the central area of ​​​​sight is imaged on the retina, but the peripheral area is imaged behind the retina. The retina senses that the image is behind, promoting the eye axis direction. grow later, thereby deepening the degree. At present, one of the main ways to alleviate the development of myopia is the "defocus lens". The central area has a normal power, and the peripheral area is adjusted through optical design partitions, so that the image in the peripheral area falls in front of the retina.

How to use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values ​​to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the &quot;MySQL Native Password&quot; plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

How to use MySQL stored procedures in PHP? How to use MySQL stored procedures in PHP? Jun 02, 2024 pm 02:13 PM

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

New stacking process! Xiaomi MIX Fold 4 is equipped with Jinshajiang 'three-dimensional special-shaped' battery for the first time New stacking process! Xiaomi MIX Fold 4 is equipped with Jinshajiang 'three-dimensional special-shaped' battery for the first time Jul 20, 2024 am 03:20 AM

According to news on July 19, Xiaomi MIX Fold 4, the first flagship folding new phone, was officially released tonight and is equipped with a "three-dimensional special-shaped battery" for the first time. According to reports, Xiaomi MIX Fold4 has achieved a major breakthrough in battery technology and designed an innovative "three-dimensional special-shaped battery" specifically for folding screens. Traditional folding screen devices mostly use conventional square batteries, which have low space utilization efficiency. In order to solve this problem, Xiaomi did not use the common winding battery cells, but developed a new lamination process to create a new form of battery, which greatly improved the space utilization. Battery Technology Innovation In order to accurately alternately stack positive and negative electrode sheets and ensure the safe embedding of lithium ions, Xiaomi has developed a new ultrasonic welding machine and lamination machine to improve welding and cutting accuracy.

See all articles