4

I was wondering what the difference is between mysql-server and mysql-client and came upon this stackoverflow post explaining the difference. I was curious if installing mysql-server also included mysql-client. So, after creating a fresh AWS Ubuntu instance, I ran which which mysqld and which mysql to confirm nothing came preinstalled with the AWS instance, and sure enough both commands returned nothing. However, after running sudo apt install mysql-server, when I ran which mysql and which mysqld they both returned something: which mysqld returned /usr/sbin/mysqld and which myself returned /usr/bin/mysql, suggesting that my installation of mysql-server installed both the client and the server. Is that accurate? As I mentioned, the stack overflow post I visited earlier indicated they were distinct pieces of software, so I'm wondering why installing mysql-server would install the client as well?

2
  • Yup. Check for yourself. sudo apt install -s mysql-server
    – KGIII
    Commented Jan 17, 2021 at 2:55
  • +1 for the clarification of the difference between mysql and mysqld. I am not sure why mysql-server installs the client part as well but it looks logical: how can you use the server without at least one client? Commented Jan 18, 2021 at 7:47

1 Answer 1

6

They are separate pieces of software, but installing mysql-server installs mysql-client as well, because you can use mysql-client to connect to the server, even over localhost. If you look at the package listing for mysql-server, you will see it depends on mysql-server-8.0, which depends on mysql-client-8.0, causing apt to install the client as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .