deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
163源
deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main non-free contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main non-free contrib
在root环境中运行如下命令Run the following command with sudo or as root:
apt-get install apache2 mariadb-server php-mysql
为MariaDB下的root用户设置密码Add a password to the user ROOT of MariaDB
跟mysql安装不同,在设置导向时可以设置root密码。这里需要手动运行代如下代码。It seems, unlike mysql, MariaDB is not asking to setup a root password when you install it. This means it is a step faster to run development apps, but you will need to set it up manually. Simply run:
mysqladmin -u root password 'enter password here'
and restart the service然后重启服务
service mysql restart
Install 安装 PHPMyAdmin
You probably wants to install PHPMyAdmin to simplify the management of your databases (Can be easily done with the web interface). The installation is simple, still in root or with sudo run:下面我们使用apt来安装一下phpmyadmin,在终端中运行如下命令
apt-get install phpmyadmin
however, MySQL 5.7 (and thus MariaDB) changed their model for security. Now to connect to MySQL root, you will need sudo or to be logged in as root on your machine. This also means that phpMyAdmin will not be able to use root as a user.
You will need to create a dedicated user to do so. Here is how:下面手动创建一个用户并且给数据库授权
mysql -u root
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Replace newuser with the user you want and password with the password you want.
The restart the service.重启服务
service mysql restart
Now you should have access to Phpmyadmin at and use the newly created user/password combo to use PhpMyAdmin.下面可以在浏览器中输入如下地址运行phpmyadmin
Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 “Trusty Tahr”映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。
Google Compute Engine GCE就是Google家卖VPS的,线路质量好,地区众多和微软的Azure一样,就是贵,一般人买不起。GCE的最低配置是5刀一个月,CPU、内存、硬盘都是独立按分钟算钱,面向中国的流量比较贵,大约为1GB 1元多,但是对比阿里云香港B其实优势不大,阿里云香港B流量是1元/GB,机器配置也高一些,CN2的网络质量还是非常不错的。