Installing MySQL on Ubuntu is simple:
apt-get install mysql-server
Please update before installation:
apt-get update apt-get upgrade
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