Upgrade mysql to 5.7 in ubuntu and use tumysql
0 Preface
A few days ago, the Library said that the server (Ubuntu14.04) had a security vulnerability and it would shut down if it was not fixed on time.
I checked the vulnerability list, mainly about ssh and mysql versions.
After upgrading mysql to 5.7, data is backed up before the upgrade, but no data is lost after the upgrade.
1. Configure mysql-apt and make related updates.
Sudo wget https://dev.mysql.com/get/mysql-apt-config_0.8.1-1_all.debsudo dpkg-I mysql-apt-config_0.8.1-1_all.deb # installation process select mysql5.7sudo apt-get update
2. Install the new database and update the file version.
sudo apt-get install mysql-serversudo mysql_upgrade -uroot -p
3. Restart mysql and check data
sudo service mysql restartmysqlcheck -uroot -p --all-databases
4. Modify the user directory and remote logon Configuration
# Modify the sudo service mysql stopsudo usermod-d/var/lib/mysql/mysqlsudo service mysql start # comment out bind-address = 127.0.0.1 and save sudo vim/etc/mysql /mysql. conf. d/mysqld. conf # restart sudo service mysql restart
5. Check the mysql version to see if it has been started successfully.
mysql --versionnetstat -anp | grep 'mysql'
6. Connect to mysql remotely
mysql -h ip -u root -p