Mysql 5.7.17 installation and configuration method graphic tutorial (ubuntu 16.04), 5.7.1716.04
Download the latest version of MySQL for Ubuntu Linux from the MySQL official website. Here I download:
Mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar
You can also download the following mirrors:
Http://mirrors.sohu.com/mysql/MySQL-5.7/
Command:
Copy codeThe Code is as follows: root @ ubuntu:/fly/mysql # tar-xvf ../mysql-server_5.7.17-1ubuntu16.04_amd64.deb-bundle.tar-C ./
After the package is decompressed, a total of 11 deb packages are installed one by one using the sudo dpkg-I [package name] command. Because there is a dependency between the package and the package, there is a sequence of installation here.
-Rw-r -- 1 7155 31415 841472 Nov 28 libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 1189512 Nov 28 libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 17383814 Nov 28 libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 12644 Nov 28 mysql-client_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 71282 Nov 28 mysql-common_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 6815 Nov 28 mysql-community_5.7.17-1ubuntu16.04_amd64.changes
-Rw-r -- 1 7155 31415 7357222 Nov 28 mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 24698654 Nov 28 mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 133305884 Nov 28 mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 23384678 Nov 28 mysql-community-test_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 12636 Nov 28 mysql-server_5.7.17-1ubuntu16.04_amd64.deb
-Rw-r -- 1 7155 31415 12652 Nov 28 mysql-testsuite_5.7.17-1ubuntu16.04_amd64.deb
My installation sequence 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 we need to install another dependency package calledLibmecab2After installation, continue to install the last one:
Mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
Set the Database Password during installation.
By now, all the installation is complete. Enter Mysql-u root-p to log on to the database.
Root @ ubuntu:/fly/mysql # dpkg-I mysql-common_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading mysql-common from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack mysql-common_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking mysql-common (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up mysql-common (5.7.17-1ubuntu16. 04 )...
Root @ ubuntu:/fly/mysql # dpkg-I libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading libmysqlclient20: amd64 from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking libmysqlclient20: amd64 (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up libmysqlclient20: amd64 (5.7.17-1ubuntu16. 04 )...
Processing triggers for libc-bin (2.23-0ubuntu5 )...
Root @ ubuntu:/fly/mysql # dpkg-I libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading libmysqlclient-dev from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking libmysqlclient-dev (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up libmysqlclient-dev (5.7.17-1ubuntu16. 04 )...
Processing triggers for man-db (2.7.5-1 )...
Root @ ubuntu:/fly/mysql # dpkg-I libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading libmysqld-dev from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking libmysqld-dev (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up libmysqld-dev (5.7.17-1ubuntu16. 04 )...
Root @ ubuntu:/fly/mysql # dpkg-I mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading mysql-community-client from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking mysql-community-client (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up mysql-community-client (5.7.17-1ubuntu16. 04 )...
Processing triggers for man-db (2.7.5-1 )...
Root @ ubuntu:/fly/mysql # dpkg-I mysql-client_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading mysql-client from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack mysql-client_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking mysql-client (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up mysql-client (5.7.17-1ubuntu16. 04 )...
Root @ ubuntu:/fly/mysql # dpkg-I mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb
Dpkg: warning: downgrading mysql-community-source from 5.7.17-1ubuntu16. 10 to 5.7.17-1ubuntu16. 04
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking mysql-community-source (5.7.17-1ubuntu16. 04) over (5.7.17-1ubuntu16. 10 )...
Setting up mysql-community-source (5.7.17-1ubuntu16. 04 )...
Root @ ubuntu:/fly/mysql # dpkg-I mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb
Selecting previusly unselected package mysql-community-server.
(Reading database... 212644 files and directories currently installed .)
Preparing to unpack mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb...
Unpacking mysql-community-server (5.7.17-1ubuntu16. 04 )...
Setting up mysql-community-server (5.7.17-1ubuntu16. 04 )...
Update-alternatives: using/etc/mysql. cnf to provide/etc/mysql/my. cnf (my. cnf) in auto mode
Processing triggers for systemd (229-4ubuntu13 )...
Processing triggers for ureadahead (0.100.0-19 )...
Processing triggers for man-db (2.7.5-1 )...
Root @ ubuntu:/fly/mysql # mysql-u root-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 3
Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000,201 6, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql>
Simple mysql installation method:
1. sudo apt-get install mysql-server
2. apt-get isntall mysql-client
3. sudo apt-get install libmysqlclient-dev
During the installation process, you will be prompted to set the password or something. Do not forget to set the password. After the installation is complete, run the following command to check whether the installation is successful:
Sudo netstat-tap | grep mysql
After the preceding command check, if mysql's socket is in the listen status, the installation is successful.
To log on to the mysql database, run the following command:
Mysql-u root-p
-U indicates the login user name and-p indicates the Login User Password. After the above command is entered, a prompt is displayed for entering the password. Then, you can log on to mysql by entering the password.
Then, you can view the current database through show databases.
Select mysql database to perform the next step. use the use mysql command to display the current database form: show tables.
How to execute SQL scripts in mysql
mysql> create database mydatabase; Query OK, 1 row affected (0.00 sec) mysql> use mydatabase; Database changed mysql> source ./mysql.sql Query OK, 0 rows affected, 1 warning (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.33 sec) Records: 0 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected, 1 warning (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected, 1 warning (0.00 sec) Query OK, 0 rows affected (0.04 sec) Query OK, 0 rows affected, 1 warning (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql> show tables;
Problems with dpkg installation:
Software dependency issues occur when installing mysql server:
Mysql-community-server depends on apparmor; however:
Package apparmor is not installed.
Mysql-community-server depends on libmecab2 (> = 0.996-1.2ubuntu1); however:
Package libmecab2 is not installed.
Install:
Sudo apt-get install libmecab2
Then mysql-community-server and mysql-server can be used normally.
The following error is prompted when installing any software in ubuntu:
You might want to run 'apt-get-f install' to correct these:
The following packages have unmet dependencies:
Kate: Depends: kdelibs4c2a (> =. 5.9) but it is not going to be installed
Depends: libqt3-mt (> =. 3.8b) but it is not going to be installed
Recommends: kregexpeditor but it is not installable
Kscope: Depends: kdelibs4c2a (>=4:3. 5.7-1) but it is not going to be installed
Depends: libaudio2 but it is not going to be installed
Depends: libqt3-mt (> =. 3.8really3.3.7) but it is not going to be installed
Depends: cscope but it is not going to be installed
Depends: exuberant-ctags but it is not going to be installed
Depends: graphviz but it is not going to be installed
E: Unmet dependencies. Try 'apt-get-f install' with no packages (or specify a solution ).
Solution:
Delete the two software that are not fully installed, kate and kscope.
$sudo dpkg --purge kate $sudo dpkg --purge kscope
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.