Differences between installing MySQL in different versions of Ubuntu

Time:2021-12-4

Installing MySQL on Ubuntu is simple:

apt-get install mysql-server

Please update before installation:

apt-get update
apt-get upgrade

Ali’s image library is recommended for updating (modify the file / etc / apt / sources. List)

cp /etc/apt/sources.list /etc/apt/sources.list.backup
sed -i 's/us.archive.ubuntu.com/mirrors.aliyun.com/g'

But when actually installing, I still encountered a pit: the previous Ubuntu 14.04 lts version went well (refer to the document:http://blog.csdn.net/lizuqing…), after installation, modify the configuration file/etc/mysql/my.cnf“You can directly manage mysql.

start mysql
stop mysql

But after changing to Ubuntu 16.04, everything has changed. “/ etc / MySQL / my. CNF” has become a link, which is empty when opened. Goolge later learned that since Ubuntu 15, the MySQL installation configuration file has been changed to“/etc/mysql/mysql.conf.d/mysqld.cnf“。
Well, it may be to manage MySQL through services:

service mysql start
service mysql stop