Upgrade mysql to 5.7 in ubuntu and use tumysql

Source: Internet
Author: User

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
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.