Ask a question, how to use mysql container to start two service instances: mysql-server in docker, make their data communicate with each other, and then start a mysql-client?
Detailed explanation:
First of all, attach a link to explain the difference between mysql-client and server:
##Then talk about the content and conclusion of the discussion: What I was confused about before was that it was said that the client needs to log in (host -u -p), but when I use the server, I also need to log in (-u -p), so of course I came up with the idea that client The difference with the server is whether it is connected to the host or not. If it is not connected to the host, it is the server. However, this view is actually not correct.The essential difference is: the server performs a crud operation, and the client sends a crud operation.
The server translates SQL statements into operations on memory and files. In other words, the server directly operates files. The client operates on the database/table, not directly on the file. For example: ①client: I use a Navicat to connect to a database, and this Navicat is the client. ②server: I have multiple mysql service instances. They can be located on different ports (this sentence is not important), but they are mounted in the same directory of the host (this sentence is important, for memory / file is operated), and data is shared (this sentence is not important).Little knowledge points:
①sql just knows how the server operates the data. ② Even if the C/S is on the same machine, they communicate through the network. For more Mysql related questions, please visit the PHP Chinese website:The above is the detailed content of A brief analysis of the difference between mysql-server and mysql-client. For more information, please follow other related articles on the PHP Chinese website!