Home > Database > Mysql Tutorial > body text

How to import table files to MySQL database or Oracle

黄舟
Release: 2017-08-08 14:29:40
Original
2050 people have browsed it

This article introduces a simple method of importing database tables. It only needs to use commonly used software on the computer. There is no need to install third-party database management software. I personally think it is very effective, and it has been made into a script to facilitate next time. use.

1. Create a new table file to be imported, as shown in the figure below.

How to import table files to MySQL database or Oracle

2. Take the MySQL database as an example, open the MySQL x.x (version number) Command Line Client (if it is Oracle DB Then open Sqlplus) and enter the root password.

How to import table files to MySQL database or Oracle

3. This article omits the database establishment process and directly creates the table and enters

CREATE TABLE test
(
   name VARCHAR(100) NOT NULL,
   sex VARCHAR(100) NOT NULL,
   age INT UNSIGNED NOT NULL
);
Copy after login

Create the form test, as shown in the figure below. The red circle shows that the test form has been created successfully.

How to import table files to MySQL database or Oracle

#4. Next, add insert statements in batches to the table to be inserted. First, add the front part insert into test values(', first before the name column. Insert an empty column, as shown in the figure.

How to import table files to MySQL database or Oracle

#5. Fill in the first column with insert into test values(' , you can fill in the first column by dragging it.

How to import table files to MySQL database or Oracle

#6. Insert an empty column before gender. , use the same method as above to insert ',', as shown in the figure below

How to import table files to MySQL database or Oracle#7. Use the same method. Insert the remaining relevant characters as shown below

How to import table files to MySQL database or Oracle#8. Finally, copy and paste the table into Notepad. Or other simple text processing software, next remove the relevant useless information and spaces indicated by the red circle

9. .Delete the useless information in the first line, press Ctrl+H or find the replace function directly in the notepad edit menu and replace the useless spaces How to import table files to MySQL database or Oracle

.

10. Now that the script content is ready, copy and paste it directly to the console for testing. The test results show that the table content has been inserted correctly. How to import table files to MySQL database or Oracle

How to import table files to MySQL database or Oracle

Note:

is only suitable for general-sized table insertion, if the amount of data is large It is definitely faster to use third-party database management tools

.

The above is the detailed content of How to import table files to MySQL database or Oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template