MySQL 数据库规范化设计(2)_MySQL
提示:建立一个数据库表维护规范 在一个定期基础而非等到问题出现才实施数据库表的检查是一个好主意。应该考虑到建立一个预防性维护的时间表,以协助自动问题,是你可以采取措施进行修正: 执行常规的数据库备份并允许更新日志。 安排定期的常规表检查。通过检查表,将减少使
3. 如何执行脚本
假定你将脚本存为check_tables,应该确保它是可执行的,当然建议你首先切换到专用户mysql:
$su mysql
$vi check_tables(编辑脚本,你也可以使用你喜欢的编辑器)
$chmod +x check_tables
手工执行,检测你的脚本是否有错误:
$check_tables
在理想情况下应该没有输出结果。如果系统不支持外部锁定,游客蒽那个服务器将在你检查表时改变它。此时,脚本可能会把实际没有问题的表报告呈有问题的。如果系统能够支持外部锁定,则该问题就不会出现。
在unix中用cron定期检查表
以下将说明如何建立脚本,使它通过cron并在系统启动期间执行。在这小节的例子中,笔者假定把脚本安装在/usr/local/mysql/bin中,你需要修改该过程来检查每个服务器数据目录中的表。你可以使用不同的check_tables拷贝来进行,或者通过修改它来接受一个命令行参数进行,该参数指定了想要检查的数据目录。
假定对mysql用户从crontab文件中调用脚本check_tables。
1. 首先用该用户的身份注册
$su mysql
2. 生成一个临时文件,捕获已经调度的任务
$crontab

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Our computer screens emit blue light, just like the light from the sun. This light is not that harmful. But on other nights when the lighting is slightly warmer, you'll eventually experience eye strain as you stare at the brighter blue light emitting from your computer screen for longer. Of course, you probably know all of this, and you probably already know about the night light feature that your windows have, which helps block the emission of blue light and instead uses warmer colors that are pleasant to your eyes. You've probably turned this feature on every time you feel like your eyes are burning too. But did you know you can set a schedule that automatically enables and disables the night light feature? If you don’t know yet, keep reading! Step 1: To launch the Settings app, press WIN+ simultaneously

The schedule function in Han Xiaoquan, a social app, can be said to be good news for video lovers. It is specially designed to help friends keep abreast of video content updates to ensure that you will not miss any exciting moments. However, some friends don’t know much about the specific location and viewing method of this function. So this article will introduce the update schedule position of Han Xiaoquan in detail, hoping to help everyone in need. Where is the timetable for Han Xiaoquan? 1. First open the Han Xiaoquan app and click in the lower left corner. 2. Then find and click on the left. 3. Finally, select the time you want to view, and you can see what content will be updated on that day.

Database views and tables are two different concepts in the database, with different characteristics and uses. A table is an entity that actually stores data in the database, while a view is a virtual table derived from one or more tables, used to specify way to present and manipulate data. Tables have higher data persistence, while views provide more flexible and convenient data access.

NEARProtocol: A scalable, user-friendly blockchain platform NEARProtocol is a blockchain platform using sharding technology designed to address the challenges faced by blockchain technology in terms of scalability, user-friendliness, and security. It provides developers with an efficient and user-friendly platform that enables them to easily build and deploy decentralized applications (dApps). NEARProtocol is designed to lower the barriers to blockchain development while providing a high degree of efficiency and security. By adopting sharding technology, NEARProtocol can better handle large-scale transactions and provide users with faster transaction confirmation times. Overall, NEARProtocol is designed to provide

How to use PHP to create and manage database tables With the rapid development of the Internet, databases have become an indispensable part of various websites and applications. In PHP, we can use a database management system (DBMS) such as MySQL to create and manage database tables. This article will teach you how to use PHP to implement this function, with corresponding code examples. Connect to the database First, we need to connect to the database in PHP. You can use the mysqli extension or PDO provided by PHP to achieve this function.

The differences between database views and tables are: 1. A table is a physical structure used to store data in a database, while a view is just a query result set based on a table or multiple tables; 2. A table is the physical storage unit of data, and a view only provides Rules for viewing and operating table data; 3. Views provide an advanced security mechanism for the database, and tables have no security mechanism; 4. Views are abstractions of tables; 5. Views can combine multiple tables in queries, and tables can only query a single table; 6. Tables are permanent structures in the database, views are not; 7. Views can create views with the same name, but tables cannot create tables with the same name, etc.

There are five differences between database views and tables in the database: 1. Views do not store data, but tables are the objects that actually store data; 2. The data in the view is a virtual table, and the data in the table can come from multiple sources; 3. The view inherits the structure of the query statement, while the table has its own structural definition; 4. The view cannot be updated, while the table allows direct operations on it; 5. The view is based on the permissions of the underlying table, and the table has its own access permissions.

How many pins does the Antec 650w motherboard cable have? The power cable of the Antec 650W power supply motherboard is usually 24 pins, which is the largest power interface on the motherboard. Its function is to connect the motherboard and power supply to provide power to the motherboard and other system components. In addition, the Antec 650W power supply may also include other types of power interfaces, such as CPU8pin, PCIe6+2pin, etc., for connecting other components such as the CPU and independent graphics cards. Motherboard routing tutorial Motherboard routing is the process of connecting circuits between various electronic components when designing a motherboard. In this process, factors such as circuit stability, signal transmission speed and accuracy need to be considered. When routing wiring according to the circuit diagram, pay attention to the layout and select appropriate line width and distance to avoid
