MySQL data directory location

xiaoxiao2021-03-06  43

MySQL data directory location

Author: Unknown Updated: Finishing Source: ddvip.net Updated: 2004.9.13 Contributor mail: tg * ddvip.com Conceptually, most relational database systems are similar: they are composed by a group of databases and Each database contains a set of tables. However, all systems have their own management data, MySQL is no exception. In the default setting, all data managed by MySQL Server MySQL is stored in the MySQL data directory. All databases and status files that provide information about server operation are also stored there. If you want to perform the management responsibility of mysql installation, you should be familiar with the layout and use of the data directory. This chapter includes the following: How to determine the location of the data directory. This needs to be understood in order to effectively manage its content. The server organizes and provides access to the databases and tables it managed. Where can I find what the status file generated by the server is included in the file. Their content provides information about the server running, if you encounter problems, this information will be useful. How to change the default layout or organization of a data directory or a single database. This is important for the disk resource allocation of the management system, for example, by balancing the magnetic disk in the drive, or by using more free space to place data into the file system. You can also use this knowledge to plan the layout of the new database. Even if you do not perform any mysql management responsibilities, you can also gain by reading this chapter, it will never affect your thoughts on how to run the server. The location of the data directory defaults to the location of the database in the server. If you are installing mysql in a source program packet, a typical default location may be / US r / local / var; if mysql is installed in a binary packet, / us r / local / mysql / data; Install in the RPM file, for / var / lib / mysql. The location of the data directory can be explicitly specified by -DATADIR = / P a t h / to / dir when the server is started. This option is useful if you want to place the data directory in other places rather than default. As a mysql administrator, you should know where the data directory is. If you run multiple servers, you should master the location of all data directories. However, if you don't know the location of the directory (perhaps you are replacing the previous administrator, and how many methods can be used to find it: you can use the mysqladmin variable to get the data directory from the server directly from the server. Path name. In UNIX, the output results are similar to the following: The output indicates the location / US R / L O C A L / V A r of the data directory in the server host. In Windows, the output is similar to the following: If you are running multiple servers, they will listen different TCP / IP port numbers and sockets. You can connect to each server listening to port and socket by providing appropriate -port or --socket options:% mysqladmin - port = port_num variables% mysqladmin - socket = / path / to / socket variables mysqladmin command You can run on any host you connect to the server.

转载请注明原文地址:https://www.9cbs.com/read-71407.html

New Post(0)