In Alibaba Cloud CentOS, you need to import an SQL file to the database, use wget to download the SQL file, and use the source command to import the SQL file.
① First, log on to the database:
[Root @ iZ94r80gdghZ tanteng. me] # mysql-u root-p
Enter password:
② Use the create database command to create a database:
MariaDB [(none)]> create database testxx;
Query OK, 1 row affected (0.00 sec)
③ Because the SQL file is online, you must first use the wget command to download it to the server. Log out of the database first. For example, to download an SQL file from the root directory of the website, run the wget command:
Wget ftp: // vh587135: z65t4i6t@cd551.gotoip.net/_ bak _/mysql/s587135db0_20160319231127. SQL
④ Go to the database and switch the database to the newly created database:
Use testxx;
⑤ Use the source command to import the SQL file:
Source/usr/share/nginx/html/tanteng. me/s587135db0_20160319231127. SQL
In this way, the data is successfully imported to the database through the SQL file. Then, delete the SQL file.