Ubuntu 16.04 Installation mysql-server_5.7.17

Source: Internet
Author: User
Tags mysql in

Download the latest version of Ubuntu Linux dedicated MySQL on the MySQL official website. What I'm downloading here is:

Mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar

You can also download it from the following mirrors:

http://mirrors.sohu.com/mysql/MySQL-5.7/

The Unzip file command is:

[Email protected]:/# tar-zxvf mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar-c./opt/

After unpacking, a total of 11 deb packages, with the sudo dpkg-i [package name] command to install each, because there is a dependency between package and package, there is a sequence of installation.

  1. -rw-r--r--1 7155 31415 841472 Nov 05:50 libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
  2. -rw-r--r--1 7155 31415 1189512 Nov 05:50 libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
  3. -rw-r--r--1 7155 31415 17383814 Nov 05:50 libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
  4. -rw-r--r--1 7155 31415 12644 Nov 05:50 mysql-client_5.7.17-1ubuntu16.04_amd64.deb
  5. -rw-r--r--1 7155 31415 71282 Nov 05:50 mysql-common_5.7.17-1ubuntu16.04_amd64.deb
  6. -rw-r--r--1 7155 31415 6815 Nov 05:50 mysql-community_5.7.17-1ubuntu16.04_amd64.changes
  7. -rw-r--r--1 7155 31415 7357222 Nov 05:50 mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
  8. -rw-r--r--1 7155 31415 24698654 Nov 05:50 mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
  9. -rw-r--r--1 7155 31415 133305884 Nov 05:50 mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
  10. -rw-r--r--1 7155 31415 23384678 Nov 05:50 mysql-community-test_5.7.17-1ubuntu16.04_amd64.deb
  11. -rw-r--r--1 7155 31415 12636 Nov 05:50 mysql-server_5.7.17-1ubuntu16.04_amd64.deb
  12. -rw-r--r--1 7155 31415 12652 Nov 05:50 mysql-testsuite_5.7.17-1ubuntu16.04_amd64.deb


The order of my installation is:
1.mysql-common_5.7.17-1ubuntu16.04_amd64.deb
2.libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
3.libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
4.libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb

5.mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
6.mysql-client_5.7.17-1ubuntu16.04_amd64.deb
7.mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb

Here you need to install a dependent package called libmecab2, after installation, continue to install the last one:
8.mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
The database password needs to be set during installation.
Here, all of them have been installed. Input mysql-u root-p can log into the database.

MySQL Simple installation method:

1. sudo apt-get install Mysql-server

2. Apt-get Isntall mysql-client

3. sudo apt-get install Libmysqlclient-dev

During installation, you will be prompted to set a password or something, note that the settings do not forget that after the installation is complete, you can use the following command to check if the installation is successful:

sudo netstat-tap | grep MySQL

After checking with the above command, if you see a socket with MySQL in the Listen state, the installation is successful.

Log in to MySQL database by the following command:

Mysql-u root-p

-U means to select the login user name,-p indicates the login user password, the above command input will prompt for a password, then enter the password can log in to MySQL.

then through show databases; You can view the current database.

We choose the MySQL database on the line next, using the use MySQL command, display the current database form: show tables;

How to execute SQL script under MySQL
  1. mysql> CREATE DATABASE MyDatabase;
  2. Query OK, 1 row affected (0.00 sec)
  3. mysql> use MyDatabase;
  4. Database changed
  5. Mysql> source./mysql.sql
  6. Query OK, 0 rows affected, 1 Warning (0.00 sec)
  7. Query OK, 0 rows affected (0.00 sec)
  8. Query OK, 0 rows affected (0.33 sec)
  9. Records: 0 Duplicates: 0 Warnings: 0
  10. Query OK, 0 rows affected, 1 Warning (0.00 sec)
  11. Query OK, 0 rows affected (0.00 sec)
  12. Query OK, 0 rows affected, 1 Warning (0.00 sec)
  13. Query OK, 0 rows affected (0.04 sec)
  14. Query OK, 0 rows affected, 1 Warning (0.00 sec)
  15. Query OK, 0 rows affected (0.00 sec)
  16. Mysql> Show tables;



DPKG Installation problems:

Software dependency issues when installing MySQL server:
Mysql-community-server depends on AppArmor; However:
Package AppArmor are not installed.
Mysql-community-server depends on libmecab2 (>= 0.996-1.2ubuntu1); However:
Package libmecab2 are not installed.
Then install it first:
sudo apt-get install LIBMECAB2
Then Mysql-community-server,mysql-server will be able to use it normally.

Installing any software under Ubuntu prompts for the following error:

You might want-to-run ' apt-get-f install ' to correct these:
The following packages has unmet dependencies:
KATE:DEPENDS:KDELIBS4C2A (>= 4:3.5.9) but it isn't going to be installed
DEPENDS:LIBQT3-MT (>= 3:3.3.8b) but it isn't going to be installed
Recommends:kregexpeditor but it's not installable
KSCOPE:DEPENDS:KDELIBS4C2A (>= 4:3.5.7-1) but it isn't going to be installed
Depends:libaudio2 but it isn't going to being installed
DEPENDS:LIBQT3-MT (>= 3:3.3.8really3.3.7) but it isn't going to be installed
Depends:cscope but it isn't going to being installed
Depends:exuberant-ctags but it isn't going to being installed
Depends:graphviz but it isn't going to being installed
E:unmet dependencies. Try ' apt-get-f install ' with no packages (or specify a solution).

Workaround:

Remove the hints for Kate and kscope two not fully installed software.

$sudo dpkg--purge Kate

$sudo dpkg--purge Kscope

Ubuntu 16.04 Installation mysql-server_5.7.17

Related Article

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.