To achieve this, you must first install MySQL workbench in centos. For details, refer to the previous article.Article. After installing workbench in centos, you can start exporting/importing data.
Step 1: export the database from win
Open MySQL workbench in win, and choose Database Import and Export Management in server administration on the right.
Click to select the database to export
You can select the export method below.
One is to export the selected database to a folder, and each table exists as a separate SQL file. Another method is to export data to a self-contained file. In this way, only one SQL file is exported. Select the latter.
After modifying the path, click Export.
Just export it later
In this case, you can find the self-contained SQL file in the specified directory.
Now we get the SQL file, and we can import it to centos.
Step 2: Create a new server instance in MySQL workbench under centos
First, move the SQL file from windows to centos ...... You can use various methods ...... USB flash drive, online transmission ...... Wait ......
Now we put the file in/Usr/tmpBelow.
Open MySQL workbench in centos
Create a server instance
Select Local Machine as server
Next, set the connection name, connection method (TCP or socket), host name (or IP address) and port number, and whether to save the password.
Next, workbench will test whether the connection can be established successfully.
Next, select the operating system of the server.
Next, workbench will test whether the host settings are correct.
Next, you will be asked if you need to check the settings and configurations of the new server instance.
Click "continue. Then you will be asked to set the server instance name
After the name is set, click Finish to create a new server instance.
Step 3: import database files to MySQL in centos
Double-click the server instance you just created. You can view the status of this server instance in administration.
You can start and close the server instance here to view the server logs.
You can set some configurations for this server instance:
For example, the memory usage settings:
MySQL server logging method:
Network Connection latency wait time
And so on.
These are administration functions that can help us visually manage servers.
Now we need to use its data import function. Click data import on the right of the window and select the path from the SQL file.
Click Start import.
Wait for a while.
Step 4: View imported database data
On the left side of the workbench workspace area, you can see the connection we created when we created the server instance.
Double-click to open the connection.
We can see that the database file we just imported has already appeared in the schema.
Expand the database to see the data we stored in win.