debian 8 解压安装mysql(版本5.7.19)
debian 8 解压安装mysql(版本5.7.19)
一、下载
根据目标主机的型号官网下载mysql安装包如:
mysql-server_5.7.19-1debian8_amd64.deb-bundle.tar
二、解压
tar -xvf mysql-server_5.7.19-1debian8_amd64.deb-bundle.tar
得到一些deb文件
-rw-r--r-- 1 7155 31415 835246 Jun 22 09:51 libmysqlclient20_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 1187200 Jun 22 09:51 libmysqlclient-dev_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 17302664 Jun 22 09:51 libmysqld-dev_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 12694 Jun 22 09:51 mysql-client_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 72404 Jun 22 09:51 mysql-common_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 7936438 Jun 22 09:51 mysql-community-client_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 24580740 Jun 22 09:51 mysql-community-server_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 132786954 Jun 22 09:51 mysql-community-source_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 24084482 Jun 22 09:51 mysql-community-test_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 12686 Jun 22 09:51 mysql-server_5.7.19-1debian8_amd64.deb
-rw-r--r-- 1 7155 31415 12702 Jun 22 09:51 mysql-testsuite_5.7.19-1debian8_amd64.deb
三、安装
根据需要安装必要的deb包,大致的流程和关系(用dpkg --info 指定的包.deb查看依赖)
1. dpkg -i mysql-common_5.7.19-1debian8_amd64.deb apt-get install libnuma1(根据提示下载依赖库) 2. dpkg -i mysql-community-client_5.7.19-1debian8_amd64.deb 3. dpkg -i mysql-client_5.7.19-1debian8_amd64.deb 4. dpkg -i mysql-community-server_5.7.19-1debian8_amd64.deb apt-get install libmecab2(根据提示下载依赖库,此时会弹出对话框,需要输入初始root密码) 5. dpkg -i mysql-server_5.7.19-1debian8_amd64.deb
四、配置
这个版本的mysql默认启动在127.0.0.1上了。(和PostgreSQL学的,偷笑,这个理念是对的)
如果需要通过其它电脑远程访问,需要修改配置。
五、修改
1. 文件路径
/etc/mysql/mysql.conf.d
2. 文件名
mysqld.cnf
3. 文件内容
[mysqld] pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock datadir = /var/lib/mysql log-error = /var/log/mysql/error.log # By default we only accept connections from localhost bind-address = 127.0.0.1 //修改为0.0.0.0即可。 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0