mtr Naming Conventions for Database Objects

It is possible to run test cases against a production server.
在生产服务器上运行测试用例是可能的。

This is very unlikely to happen by accident, as mysql-test-run.pl will start its own server unless you use the --extern Even so, try to write test cases in a way that reduces the risk that running tests will alter or destroy important tables, views, or other objects. (DROP DATABASE statements are particularly dangerous if written using names that could exist on a customer's machine.) To avoid such problems, we recommend the following naming conventions:
这是不太可能偶然发生的,因为mysql-test-run.pl将启动它自己的服务器,除非您使用——extern。即便如此,尝试以一种降低运行测试将改变或破坏重要表、视图或其他对象的风险的方式编写测试用例。(如果使用客户机器上可能存在的名称来编写DROP DATABASE语句,则特别危险。)为避免此类问题,我们建议采用以下命名约定:

  • User names: User names should begin with “mysql” (for example, mysqluser1, mysqluser2)
    用户名:以“mysql”开头(例如mysqluser1, mysqluser2)

  • Database names: Unless you have a special reason not to, use the default database named test that is already created for you. For tests that need to operate outside the test database, database names should contain “test” or begin with “mysql” (for example, mysqltest1, mysqltest2)
    数据库名称:除非有特殊原因,否则请使用已经为您创建的默认数据库test。对于需要在测试数据库外部操作的测试,数据库名称应该包含“test”或以“mysql”开头(例如,mysqltest1, mysqltest2)

  • Table names: t1, t2, t3, ...

  • View names: v1, v2, v3, ...

For examples of how to name objects, examine the existing test cases. Of course, you can name columns and other objects inside tables as you wish.
对于如何命名对象的例子,请检查现有的测试用例。当然,您可以根据自己的意愿命名表中的列和其他对象。

你可能感兴趣的:(mtr Naming Conventions for Database Objects)