diff --git a/docs/en/docs/Administration/figures/en-us_image_0231563137.png b/docs/en/docs/Administration/figures/en-us_image_0231563137.png new file mode 100644 index 0000000000000000000000000000000000000000..e55ccfd8251c13bbf47f37f94d2111b0c50d26f4 Binary files /dev/null and b/docs/en/docs/Administration/figures/en-us_image_0231563137.png differ diff --git a/docs/en/docs/Administration/figures/en-us_image_0231563138.png b/docs/en/docs/Administration/figures/en-us_image_0231563138.png new file mode 100644 index 0000000000000000000000000000000000000000..ccf7734682d9cde4cf0ea4ef365143109abeadbf Binary files /dev/null and b/docs/en/docs/Administration/figures/en-us_image_0231563138.png differ diff --git a/docs/en/docs/Administration/setting-up-the-database-server.md b/docs/en/docs/Administration/setting-up-the-database-server.md index b84c1dc97a4923bc3d3b86bcb3a512304f5edada..12923097670be3c7e06651a981335aa115a93f61 100644 --- a/docs/en/docs/Administration/setting-up-the-database-server.md +++ b/docs/en/docs/Administration/setting-up-the-database-server.md @@ -19,6 +19,12 @@ - [Installing, Running, and Uninstalling MySQL](#installing-running-and-uninstalling-mysql) - [Managing Database Users](#managing-database-users-1) - [Managing Databases](#managing-databases-2) + - [GreatSQL Server](#greatsql-server) + - [Software Description](#software-description-3) + - [Configuring the Environment](#configuring-the-environment-3) + - [Installing, Running, and Uninstalling MySQL](#installing-running-and-uninstalling-mysql) + - [Managing Database Users](#managing-database-users-2) + - [Managing Databases](#managing-databases-3) @@ -1438,36 +1444,36 @@ The Structured Query Language \(SQL\) used by MySQL is the most common standard ### Configuring the Environment -> **NOTE:** ->The following environment configuration is for reference only. Configure the environment based on the site requirements. +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>The following environment configurations are only reference examples, and specific configurations will be made according to actual needs -#### Disabling the Firewall and Automatic Startup +####Turn off the firewall and cancel the startup auto start -> **NOTE:** ->It is recommended that firewall be disabled in the test environment to prevent network impact. Configure the firewall based on actual requirements. +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>In testing environments, firewalls are usually turned off to avoid the influence of some network factors, and configurations are made according to actual needs. -1. Stop the firewall service as the **root** user. +1. Stop the firewall with root privileges. - ```shell - systemctl stop firewalld - ``` +```shell +systemctl stop firewalld +``` -2. Disable the firewall service as the **root** user. +2. Turn off the firewall with root privileges. - ```shell - systemctl disable firewalld - ``` +```shell +systemctl disable firewalld +``` - > **NOTE:** - >The automatic startup is automatically disabled as the firewall is disabled. +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>At the same time as executing the disable command to turn off the firewall, it also cancels the startup self start. -#### Disabling SELinux +####Change SELINOX to disabled -1. Modify the configuration file as the **root** user. +1. Modify configuration files with root privileges. - ```shell - sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux - ``` +```shell +sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux +``` #### Creating a User Group and a User @@ -2171,3 +2177,695 @@ In the preceding information: ```shell mysql -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 < db1.sql ``` + +## GreatSQL Server + +## GreatSQL Server + +### Software Introduction + +GreatSQL is a donation project under the OpenAtom Foundation, certified by the China Academy of Information and Communications Technology (CAICT) as both a trusted open-source community and a trusted open-source project. + +GreatSQL is an **open-source and free** database that can meet financial-grade application scenarios on ordinary hardware. It features **high availability**, **high performance**, **high compatibility**, and **high security**, making it an ideal alternative to MySQL or Percona Server for MySQL. + +GreatSQL strives to maintaining the openness of open-source. It adopts the [GPLv2 license](https://gitee.com/GreatSQL/GreatSQL/blob/master/LICENSE). + +GreatSQL is primarily maintained and operated by the [GreatSQL Community](https://greatsql.cn). It has attracted numerous community maintainers, enthusiasts, and users who contribute in various ways, including code submissions, feature testing, bug discovery, and documentation improvements. + +### Configuring the Environment + +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>The following environment configurations are only reference examples, and specific configurations will be made according to actual needs + +####Turn off the firewall and cancel the startup auto start + +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>In testing environments, firewalls are usually turned off to avoid the influence of some network factors, and configurations are made according to actual needs. + +1. Stop the firewall with root privileges. + +```shell +systemctl stop firewalld +``` + +2. Turn off the firewall with root privileges. + +```shell +systemctl disable firewalld +``` + +>! [] (./public_stys-resources/icon node. gif) * * Explanation:** +>At the same time as executing the disable command to turn off the firewall, it also cancels the startup self start. + +####Change SELINOX to disabled + +1. Modify configuration files with root privileges. + +```shell +sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux +``` + +#### Creating a User Group and a User + +> **NOTE:** +>In the server environment, independent users are assigned to each process to implement permission isolation for security purposes. The user group and user are created for the OS, not for the database. + +Create a MySQL user or user group as the **root** user. + + ```shell + groupadd mysql + ``` + + ```shell + useradd -r -g mysql -s /sbin/nologin mysql + ``` + +#### Creating Data Drives + +> **NOTE:** +> +>- When testing the ultimate performance, you are advised to attach NVMe SSDs with better I/O performance to create GreatSQL test instances to avoid the impact of disk I/O on the performance test result. This section uses NVMe SSDs as an example. For details, see Step 1 to Step 4. +>- In a non-performance test, run the following command as the **root** user to create a data directory. Then skip this section. +> `mkdir /data` + +1. Create a file system \(xfs is used as an example as the **root** user. Create the file system based on the site requirements.\). If a file system has been created for a disk, an error will be reported when you run this command. You can use the **-f** parameter to forcibly create a file system. + + ```shell + mkfs.xfs /dev/nvme0n1 + ``` + +2. Create a data directory. + + ```shell + mkdir /data + ``` + +3. Mount disks. + + ```shell + mount -o noatime,nobarrier /dev/nvme0n1 /data + ``` + +#### Creating GreatSQL Data Directory + +1. In the created data directory **/data**, create directories for processes and grant permissions to the MySQL group or user created as the **root** user. + + ```shell + mkdir -p /data/GreatSQL + cd /data/GreatSQL + chown -R mysql:mysql /data/GreatSQL + ``` + +### Installing, Running, and Uninstalling GreatSQL + +#### Installing GreatSQL + +>! [] (./public_Sys-resources/icon usage. gif) * * Note:** +>Before installing GreatSQL, please check if MySQL/Percona Server For MySQL/MariaDB and other MySQL homomorphic databases have been installed first. If they have already been installed, they need to be uninstalled first, otherwise GreatSQL cannot be installed again, which may cause conflicts. + +1. Configure the local yum source. For details, see [Configuring the Repo Server](./configuring-the-repo-server.md). + +2. Clear the cache. + + ```shell + dnf clean all + ``` + +3. Create a cache. + + ```shell + dnf makecache + ``` + +4. Install the MySQL server as the **root** user. + + ```shell + dnf install greatsql-server + ``` + +If there is a conflict error during installation, you need to uninstall MySQL/Percona Server For MySQL/MariaDB and other MySQL homomorphic databases first. + +5. Check the installed RPM package. + + ```shell + rpm -qa | grep greatsql-server + ``` + +#### Running MySQL + + +1. Modify configuration file `/etc/my.cnf` + 1. Modify the/etc/my.cnf file with **root** user, including the software installation path basedir, datadir, listening port number, innobd_fuffer_pool_2, etc., according to the actual situation. + + ```shell + vi /etc/my.cnf + ``` + + Edit `/etc/my.cnf` as follows (the following is a example): + + ```text + [client] + datadir = /data/GreatSQL/mysql.sock + + [mysqld] + !includedir /etc/my.cnf.d + user = mysql + datadir = /data/GreatSQL + socket = /data/GreatSQL/mysql.sock + log-error = /data/GreatSQL/mysqld.log + pid-file = /data/GreatSQL/mysqld.pid + slow_query_log = ON + long_query_time = 0.01 + log_slow_verbosity = FULL + log_error_verbosity = 3 + innodb_buffer_pool_size = 1G + innodb_redo_log_capacity = 256M + innodb_io_capacity = 10000 + innodb_io_capacity_max = 20000 + innodb_flush_sync = OFF + ``` + +If you want GreatSQL to achieve better running status and performance, you can refer to the [my.cnf configuration file reference template](https://gitee.com/GreatSQL/GreatSQL-Doc/blob/master/docs/my.cnf-example) provided by the GreatSQL community. + + 2. Ensure that the my.cnf configuration file is modified correctly. + + ```shell + cat /etc/my.cnf + ``` + +  + + 3. Start GreatSQL database with root user + + ```shell + systemctl start mysqld + ``` + + The initial startup may be slower and may take several minutes due to the task of initializing the GreatSQL database. + + After initialization is complete, check if there are already data files in the directory corresponding to the 'datadir' configuration parameter, as well as the corresponding log files `/data/GreatSQL/mysqld.log`. + + ```shell + ls -la /data/GreatSQL + ``` + + 查看`/data/GreatSQL/mysqld.log`日志文件,若其中包括“Bootstrapping complete”表示初始化数据库完成,且包含“A temporary password is generated for root@localhost: =dz;kqt8svrF”这样的信息,则其中的“=dz;kqt8svrF”为GreatSQL数据库root账户的初始密码,第一次登入后要立即修改才能继续使用GreatSQL。 + + Check the `/data/GreatSQL/mysqld.log` log file. If it includes the message "Bootstrapping complete," it indicates that the database initialization is finished. Additionally, if it contains a line such as "A temporary password is generated for root@localhost: =dz;kqt8svrF," the string "=dz;kqt8svrF" is the initial temporary password for the `root@localhost` account in the GreatSQL database. After logging in for the first time, you must change this password immediately to continue using GreatSQL. + + + 4. Login to GreatSQL。 + + > **说明:** + >- When prompted to enter a password, please enter the temporary password generated in [step 4](#li15634560588). + + ```shell + mysql -uroot -p + ``` + +  + + 5. Change the temporary password + + As shown in the screenshot above, after logging into the GreatSQL database for the first time, you must modify the temporary password before proceeding with further operations. + + ```shell + greatsql [(none)]> \s + ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. + greatsql [(none)]> ALTER USER USER() IDENTIFIED BY 'GreatSQL@202X'; + Query OK, 0 rows affected (0.00 sec) + ``` + + 6. Create a new database account named `GreatSQL` that allows access from any server, and grant this account full permissions to perform all operations on all data objects within the database named `test`. + + ```shell + -- Specify the password for the new account GreatSQL as "GreatSQL-202X". It is recommended to modify it to a password of your own + greatsql [(none)]> CREATE USER GreatSQL@'%' IDENTIFIED BY 'GreatSQL-202X'; + Query OK, 0 rows affected (0.00 sec) + + greatsql [(none)]> GRANT ALL ON test.* TO GreatSQL@'%'; + Query OK, 0 rows affected (0.00 sec) + ``` + + 7. Creating a new database named `test` + + ```shell + greatsql [(none)]> CREATE DATABASE test; + Query OK, 1 row affected (0.00 sec) + ``` + + 8. exit GreatSQL server + + Run SQL command `\q` or `exit` to exit GreatSQL database Server. + + ```shell + greatsql> exit + ``` + + 9. Switch to the newly created `GreatSQL` account to log in and operate the database. + + ```shell + -- Use the password "GreatSQL-202X" specified when creating the GreatSQL account, or use the password you have set yourself. + -- The test specified afterward means that the test database will be used immediately after logging in. Ensure to include a space; otherwise, it will be interpreted as part of the password. + mysql -uGreatSQL -p test + Enter password: + ... + + -- Creating new table + greatsql [test]> CREATE TABLE t1(id INT PRIMARY KEY); + Query OK, 0 rows affected (1.48 sec) + + -- show tables + greatsql [test]> SHOW TABLES; + +----------------+ + | Tables_in_test | + +----------------+ + | t1 | + +----------------+ + 1 row in set (0.00 sec) + + -- inserting some rows + greatsql [test]> INSERT INTO t1 SELECT RAND()*1024; + Query OK, 1 row affected (0.34 sec) + Records: 1 Duplicates: 0 Warnings: 0 + + -- reading rows from table + greatsql [test]> SELECT * FROM t1; + +-----+ + | id | + +-----+ + | 565 | + +-----+ + 1 row in set (0.00 sec) + ``` + + This completes the basic operations for the GreatSQL database. + + For more related SQL commands/syntax, please refer to the manual: [SQL Statements](https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html). + + For more content on application development based on GreatSQL, please refer to: [Application Development](https://greatsql.cn/docs/12-dev-guide/12-dev-guide.html). + +#### Uninstalling GreatSQL + +1. Stop the database process as the **root** user. + + ```shell + systemctl stop mysqld + ``` + +2. Execute the command **dnf remove -y greatsql-server** with root privileges to uninstall GreatSQL. + + ```shell + dnf remove -y greasql-server + ``` + +### Managing Database Users + +#### Creating Users + +Run the **CREATE USER** statement to create one or more users and set corresponding passwords. + +```sql +CREATE USER 'username'@'hostname' IDENTIFIED BY 'password'; +``` + +In the preceding information: + +- _username_: name of a user. +- _host_: hostname, that is, the name of the host where the user connects to the database. As a local user, you can set the parameter to **localhost**. If the host name is not specified during user creation, the host name is **%** by default, indicating a group of hosts. +- _password_: password for logging in to the server. The password can be null. If the password is null, the user can log in to the server without entering the password. This method, however, is not recommended because it provides low security. + +To use the **CREATE USER** statement, you must have the **INSERT** permission on the database or the global **CREATE USER** permission. + +After a user account is created using the **CREATE USER** statement, a record is added to the user table in the database. If the account to be created exists, an error will occur during statement execution. + +A new user has few permissions and can perform only operations that do not require permissions. For example, a user can run the **SHOW** statement to query the list of all storage engines and character sets. + +##### Example + + Create a local user whose password is "GreatSQL@202X-local" and username is "GreatSQL-local". + +```sql +CREATE USER GreatSQL_local@localhost IDENTIFIED BY 'GreatSQL@202X'; +``` + + Create a user whose password is "GreatSQL@202X-remote", username is **GreatSQL_remote**, and hostname is **192.168.1.100**. + +```sql +CREATE USER 'GreatSQL_remote'@'192.168.1.100' IDENTIFIED BY 'GreatSQL@202X-remote'; +``` + +#### Viewing Users + +Run the **SHOW GRANTS** or **SELECT** statement to view one or more users. + +View a specific user: + +```sql +SHOW GRANTS [FOR 'username'@'hostname']; +``` + +```sql +SELECT USER,HOST,PASSWORD FROM mysql.user WHERE USER='username'; +``` + +View all users: + +```sql +SELECT USER,HOST FROM mysql.user; +``` + +In the preceding information: + +- _username_: name of a user. +- _hostname_: host name. + +##### Example + + View the user **userexample1**. + +```sql +SHOW GRANTS FOR GreatSQL; ++----------------------------------------------------+ +| Grants for GreatSQL@% | ++----------------------------------------------------+ +| GRANT USAGE ON *.* TO `GreatSQL`@`%` | +| GRANT ALL PRIVILEGES ON `test`.* TO `GreatSQL`@`%` | ++----------------------------------------------------+ +2 rows in set (0.00 sec) +``` + + View all users in the MySQL database. + +```sql +SELECT USER,HOST FROM mysql.user; +``` + +#### Modifying Users + +##### Modifying a Username + +Run the **RENAME USER** statement to change one or more existing usernames. + +```sql +RENAME USER 'oldusername'@'hostname' TO 'newusername'@'hostname'; +``` + +In the preceding information: + +- _oldusername_: original username. +- _newusername_: new username. +- _hostname_: host name. + +The **RENAME USER** statement is used to rename an existing account. If the original account does not exist in the system or the new account exists, an error will occur when the statement is executed. + +To use the **RENAME USER** statement, you must have the **UPDATE** permission on the database or the global **CREATE USER** permission. + +##### Example of Modifying a User + + Change the username **userexample1** to **userexample2** and change the hostname to **localhost**. + +```sql +RENAME USER 'userexample1'@'localhost' TO 'userexample2'@'localhost'; +``` + +##### Modifying a User Password + +Use the **SET PASSWORD** statement to modify the login password of a user. + +```sql +SET PASSWORD FOR 'username'@'hostname' = 'newpassword'; +``` + +In the preceding information: + +- **FOR'**_username_**'@'**_hostname_**'**: specifies the username and hostname whose password is to be changed. This parameter is optional. +- _newpassword_: new password. + +If the **FOR** clause is not added to the **SET PASSWORD** statement, the password of the current user is changed. + +The **FOR** clause must be given in the format of **'**_username_**'@'**_hostname_**'**, where _username_ indicates the username of the account and _hostname_ indicates the hostname of the account. + +The account whose password is to be changed must exist in the system. Otherwise, an error occurs when the statement is executed. + +##### Example of Changing a User Password + + Change the password of user **GreatSQL_remote** whose hostname is **localhost** to "GreatSQL@@202X-remote". + +```sql +SET PASSWORD FOR 'GreatSQL_remote'@'192.168.1.100' = 'GreatSQL@@202X-remote'; +``` + +#### Deleting Users + +Use the **DROP USER** statement to delete one or more user accounts and related permissions. + +```sql +DROP USER 'username1'@'hostname1' [,'username2'@'hostname2']...; +``` + +> **CAUTION:** +>The deletion of users does not affect the tables, indexes, or other database objects that they have created, because the database does not record the accounts that have created these objects. + +The **DROP USER** statement can be used to delete one or more database accounts and their original permissions. + +To use the **DROP USER** statement, you must have the **DELETE** permission on the database or the global **CREATE USER** permission. + +In the **DROP USER** statement, if the hostname of an account is not specified, the hostname is **%** by default. + +##### Example + + Delete the local user **userexample**. + +```sql +DROP USER 'userexample'@'localhost'; +``` + +#### Granting Permissions to a User + +Run the **GRANT** statement to grant permissions to a new user. + +```sql +GRANT privileges ON databasename.tablename TO 'username'@'hostname'; +``` + +In the preceding information: + +- **ON** clause: specifies the object and level on which the permission is granted. +- _privileges_: indicates the operation permissions of a user, such as **SELECT**, INSERT, and **UPDATE**. To grant all permissions to a user, use **ALL**. +- _databasename_: database name. +- _tablename_: table name. +- **TO** clause: sets the user password and specifies the user to whom the permission is granted. +- _username_: name of a user. +- _hostname_: host name. + +To grant the user the permission to operate all databases and tables, use asterisks \(\*\), for example, **\*.\***. + +If you specify a password for an existing user in the **TO** clause, the new password will overwrite the original password. + +If the permission is granted to a non-existent user, a **CREATE USER** statement is automatically executed to create the user, but the password must be specified for the user. + +##### Example + + Grant the **SELECT** and **INSERT** permissions to local user **userexample**. + +```sql +GRANT SELECT,INSERT ON *.* TO 'userexample'@'localhost'; +``` + +#### Deleting User Permissions + +Run the **REVOKE** statement to delete the permissions of a user, but the user will not be deleted. + +```sql +REVOKE privilege ON databasename.tablename FROM 'username'@'hostname'; +``` + +The parameters in the **REVOKE** statement are the same as those in the **GRANT** statement. + +To use the **REVOKE** statement, you must have the global **CREATE USER** or **UPDATE** permission for the database. + +##### Example + + Delete the **INSERT** permission of local user **userexample**. + +```sql +REVOKE INSERT ON *.* FROM 'userexample'@'localhost'; +``` + +### Managing Databases + +#### Creating a Database + +Run the **CREATE DATABASE** statement to create a database. + +```sql +CREATE DATABASE databasename; +``` + +In the preceding command, _databasename_ can be replaced with the database name, which is case insensitive. + +##### Example + + Create a database named **databaseexample**. + +```sql +CREATE DATABASE databaseexample; +``` + +#### Viewing a Database + +Run the **SHOW DATABASES** statement to view a database. + +```sql +SHOW DATABASES; +``` + +##### Example + + View all databases. + +```sql +SHOW DATABASES; +``` + +#### Selecting a Database + +Generally, you need to select a target database before creating or querying a table. Use the **USE** statement to select a database. + +```sql +USE databasename; +``` + +In the preceding command, _databasename_ indicates the database name. + +##### Example + + Select the **databaseexample** database. + +```sql +USE databaseexample; +``` + +#### Deleting a Database + +Run the **DROP DATABASE** statement to delete a database. + +> **CAUTION:** +>Exercise caution when deleting a database. Once a database is deleted, all tables and data in the database will be deleted. + +```sql +DROP DATABASE databasename; +``` + +In the preceding command, _databasename_ indicates the database name. + +The **DROP DATABASE** command is used to delete an existing database. After this command is executed, all tables in the database are deleted, but the user permissions of the database are not automatically deleted. + +To use **DROP DATABASE**, you need the **DROP** permission on the database. + +**DROP SCHEMA** is a synonym of **DROP DATABASE**. + +##### Example + + Delete the **databaseexample** database. + +```sql +DROP DATABASE databaseexample; +``` + +#### Backing Up a Database + +Run the **mysqldump** command as the **root** user to back up the database. + +Back up one or more tables: + +```shell +mysqldump [options] databasename [tablename ...] > outfile +``` + +Back up one or more databases: + +```shell +mysqldump [options] -databases databasename ... > outfile +``` + +Back up all databases: + +```shell +mysqldump [options] -all-databases > outputfile +``` + +In the preceding information: + +- _databasename_: database name. +- _tablename_: name of a data table. +- _outfile_: database backup file. +- _options_: parameter option of the **mysqldump** command. Multiple parameters can be separated by spaces. The common parameters of the **mysqldump** command are as follows: + - **-u, \-\-user**= _username_: specifies the username. + - **-p, \-\-password**\[= _password_\]: specifies the password. In the following examples, the password is specified as "123456". You need to adjust it according to your actual situation. + - **-P, \-\-port**= _portnumber_: specifies the port number. + - **-h, \-\-host**= _hostname_: specifies the hostname. + - **-r, \-\-result-file**= _filename_: saves the export result to a specified file, which is equivalent to **\>**. + - **-t**: backs up data only. + - **-d**: backs up the table structure only. + +##### Example + + Back up all the databases of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **alldb.sql** file. + +```shell +mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 --all-databases > alldb.sql +``` + + Back up the db1 database of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **db1.sql** file. + +```shell +mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 --databases db1 > db1.sql +``` + + Back up the tb1 table of the db1 database of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **db1tb1.sql** file. + +```shell +mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 db1 tb1 > db1tb1.sql +``` + + Back up only the table structure of the db1 database of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **db1.sql** file. + +```shell +mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -d db1 > db1.sql +``` + + Back up only the table structure of the db1 database of user **root** on port **3306** of the host whose IP address is **192.168.202.144** to the **db1.sql** file. + +```shell +mysqldump -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 > db1.sql +``` + +#### Restoring a Database + +Run the **mysql** command as the **root** user to restore the database. + +Restore one or more tables: + +```shell +mysql -h hostname -P portnumber -u username -ppassword databasename < infile +``` + +In the preceding information: + +- _hostname_: host name. +- _portnumber_: port number. +- _username_: name of a user. +- _password_: password. +- _databasename_: database name. +- _infile_: **outfile** parameter in the **mysqldump** command. + +##### Example + + Restore a database. + +```shell +mysql -h 192.168.202.144 -P 3306 -uroot -p123456 -t db1 < db1.sql +``` + diff --git a/docs/zh/docs/Administration/figures/zh-cn_image_0231563137.png b/docs/zh/docs/Administration/figures/zh-cn_image_0231563137.png new file mode 100644 index 0000000000000000000000000000000000000000..e55ccfd8251c13bbf47f37f94d2111b0c50d26f4 Binary files /dev/null and b/docs/zh/docs/Administration/figures/zh-cn_image_0231563137.png differ diff --git a/docs/zh/docs/Administration/figures/zh-cn_image_0231563138.png b/docs/zh/docs/Administration/figures/zh-cn_image_0231563138.png new file mode 100644 index 0000000000000000000000000000000000000000..ccf7734682d9cde4cf0ea4ef365143109abeadbf Binary files /dev/null and b/docs/zh/docs/Administration/figures/zh-cn_image_0231563138.png differ diff --git "a/docs/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" "b/docs/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" index 541c6bc31dfbdad0f50410d89a6d7dbe935523a0..efd4f8e5a395283037f4636e2299e7543f6a6eac 100644 --- "a/docs/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" +++ "b/docs/zh/docs/Administration/\346\220\255\345\273\272\346\225\260\346\215\256\345\272\223\346\234\215\345\212\241\345\231\250.md" @@ -2,13 +2,13 @@ - [搭建数据库服务器](#搭建数据库服务器) - - [PostgreSql服务器](#postgresql服务器) + - [PostgreSQL服务器](#postgresql服务器) - [软件介绍](#软件介绍) - [配置环境](#配置环境) - [安装、运行和卸载](#安装运行和卸载) - [管理数据库角色](#管理数据库角色) - [管理数据库](#管理数据库) - - [Mariadb服务器](#mariadb服务器) + - [MariaDB服务器](#mariadb服务器) - [软件介绍](#软件介绍-1) - [配置环境](#配置环境-1) - [安装、运行和卸载](#安装运行和卸载-1) @@ -20,19 +20,25 @@ - [安装、运行和卸载](#安装运行和卸载-2) - [管理数据库用户](#管理数据库用户-1) - [管理数据库](#管理数据库-2) + - [GreatSQL服务器](#greatsql服务器) + - [软件介绍](#软件介绍-3) + - [配置环境](#配置环境-3) + - [安装、运行和卸载](#安装运行和卸载-3) + - [管理数据库用户](#管理数据库用户-2) + - [管理数据库](#管理数据库-3) -## PostgreSql服务器 +## PostgreSQL服务器 ### 软件介绍 PostgreSQL的架构如[图1](#fig26022387391)所示,主要进程说明如[表1](#table62020913417)所示。 -**图 1** PostgreSql架构 +**图 1** PostgreSQL架构  -**表 1** PostgreSql中的主要进程说明 +**表 1** PostgreSQL中的主要进程说明