申明:本博客的行文思路和大致内容转载自http://www.cnblogs.com/JasonTech0713/p/6690949.html
与转载博客的区别在于,本博客属于在完全无网络下安装及配置mysql,包括依赖包的安装和相关包的下载链接
一、在官网下载mysql
官网地址:https://dev.mysql.com/downloads/mysql/
因为我的电脑是64位ubuntu16.04,因此我下载的版本是:
mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
二、解压
tar –xvf mysql-server_5.7.18-1ubuntu16.04_amd64.deb-bundle.tar
得到以下文件:
libmysqlclient20_5.7.18-1ubuntu16.04_amd64.deb
libmysqlclient-dev_5.7.18-1ubuntu16.04_amd64.deb
libmysqld-dev_5.7.18-1ubuntu16.04_amd64.deb
mysql-client_5.7.18-1ubuntu16.04_amd64.deb
mysql-common_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-client_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-source_5.7.18-1ubuntu16.04_amd64.deb
mysql-community-test_5.7.18-1ubuntu16.04_amd64.deb
mysql-server_5.7.18-1ubuntu16.04_amd64.deb
mysql-testsuite_5.7.18-1ubuntu16.04_amd64.deb
三、安装所需的包
1. sudo dpkg –i mysql-common_5.7.18-1ubuntu16.04_amd64.deb
2. sudo dpkg-preconfigure –i mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
输入root密码,即设定数据库初始密码
3. sudo dpkg –i libmysqlclient20_5.7.18-1ubuntu16.04_amd64.deb
4. sudo dpkg –i libmysqlclient-dev_5.7.18-1ubuntu16.04_amd64.deb
5. sudo dpkg –i libmysqld-dev_5.7.18-1ubuntu16.04_amd64.deb
6. sudo dpkg –i mysql-community-client_5.7.18-1ubuntu16.04_amd64.deb
注意:安装此步骤需要libaio1依赖包,安装包程序在文末已提供
7. sudo dpkg –i mysql-client_5.7.18-1ubuntu16.04_amd64.deb
8. sudo dpkg –i mysql-common_5.7.18-1ubuntu16.04_amd64.deb
9. sudo dpkg –i mysql-community-server_5.7.18-1ubuntu16.04_amd64.deb
注意:安装此步骤需要libmecab2依赖包,安装包程序在文末已提供
10. sudo dpkg –i mysql-server_5.7.18-1ubuntu16.04_amd64.deb
whereis mysql
mysql --version
六、登录
mysql -u 用户名 –p
Enter password:[输入设定的初始密码]
七、修改安装过程中的root初始密码
在mysql系统外,使用mysqladmin
#mysqladmin –u root –p password “123456”
八、依赖包链接
http://pan.baidu.com/s/1hsoqRfm