Home » Code » 安装mysql 5.7.13

安装mysql 5.7.13

一、添加Mysql APT源


然后执行:$ sudo dpkg -i mysql-apt-config_0.7.3-1_all.deb。


$ sudo apt-get update
$ sudo apt-get upgrade


直接执行:sudo apt-get install mysql-server。安装过程会提示输入密码,很快,速度没问题不过十来几十秒,即完成最新版Mysql 5.7.13的安装。

如果提示:mysqld: Can’t create/write to file ‘/var/lib/mysql/is_writable’,试着执行:

sudo chown mysql /var/lib/mysql
sudo chgrp mysql /var/lib/mysql

如若提示:dpkg: error processing package mysql-community-server (–configure):,试着执行:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

再来执行安装,估计就成了(以上是我亲测)。这种办法较编译源码安装,要快上不少。安装完成后,已注册好服务,service mysql stop/start/restart可用。配置文件在/etc/mysql。

root@iZ94il5ax7kZ:/usr/local/src/mysql# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libmecab2 mysql-client mysql-common mysql-community-client
The following NEW packages will be installed:
  libmecab2 mysql-client mysql-common mysql-community-client
  mysql-community-server mysql-server
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 266 kB/27.2 MB of archives.
After this operation, 214 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://repo.mysql.com/apt/ubuntu/ trusty/mysql-5.7 mysql-common amd64 5.7.13-1ubuntu14.04 [266 kB]
Fetched 266 kB in 0s (3,399 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 122487 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.13-1ubuntu14.04_amd64.deb ...
Unpacking mysql-common (5.7.13-1ubuntu14.04) ...
Selecting previously unselected package mysql-community-client.
Preparing to unpack .../mysql-community-client_5.7.13-1ubuntu14.04_amd64.deb ...
Unpacking mysql-community-client (5.7.13-1ubuntu14.04) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../mysql-client_5.7.13-1ubuntu14.04_amd64.deb ...
Unpacking mysql-client (5.7.13-1ubuntu14.04) ...
Selecting previously unselected package libmecab2.
Preparing to unpack .../libmecab2_0.996-1.1_amd64.deb ...
Unpacking libmecab2 (0.996-1.1) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack .../mysql-community-server_5.7.13-1ubuntu14.04_amd64.deb ...
Unpacking mysql-community-server (5.7.13-1ubuntu14.04) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.13-1ubuntu14.04_amd64.deb ...
Unpacking mysql-server (5.7.13-1ubuntu14.04) ...
Processing triggers for man-db ( ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mysql-common (5.7.13-1ubuntu14.04) ...
Setting up mysql-community-client (5.7.13-1ubuntu14.04) ...
Setting up mysql-client (5.7.13-1ubuntu14.04) ...
Setting up libmecab2 (0.996-1.1) ...
Setting up mysql-community-server (5.7.13-1ubuntu14.04) ...
 * MySQL Community Server 5.7.13 is started
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mysql-server (5.7.13-1ubuntu14.04) ...
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
root@iZ94il5ax7kZ:/usr/local/src/mysql# mysql -uroot -p************
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.



Leave a Reply

Your email address will not be published. Required fields are marked *


Time limit is exhausted. Please reload CAPTCHA.