安裝Linux用的是騰訊雲的centos7.5,需要安裝有環境有mysql5.7 .netcore2.1 nginx1.14 1.首先是mysql的安裝 我用的鏈接工具是putty,首先root登入系統 採用yum的方式安裝mysql 1.安裝mysql的yum源 2.安裝mysql-communi ...
安裝Linux用的是騰訊雲的centos7.5,需要安裝有環境有mysql5.7 .netcore2.1 nginx1.14
1.首先是mysql的安裝
我用的鏈接工具是putty,首先root登入系統
採用yum的方式安裝mysql
1.安裝mysql的yum源
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2.安裝mysql-community.repo
mysql-community-source.repo依賴包
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
3.安裝mysql
yum install -y mysql-server
安裝完成
4.運行mysql,並查看運行狀態
service mysqld start
service mysqld status
運行成功
5.由於mysql5.7 會生成一個隨機密碼,所有先查看密碼 (mysql5.6 也有隨機密碼,5.5不知道)
grep "password" /var/log/mysqld.log
箭頭值得就是隨機密碼,我們記錄下來
6.登錄 MySQL並更新用戶 root 的密碼,這裡我們設置了passwordA1.作為新密碼
mysql -u root -p
SET PASSWORD = PASSWORD('passwordA1.'); ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; flush privileges;
7.設置mysql可以被任意ip訪問和root 本地訪問
grant all privileges on *.* to root@"%" identified by "passwordA1.";
grant all privileges on *.* to root@"localhost" identified by "passwordA1.";
flush privileges;
8.MySQL控制命令:啟動、停止、重啟、查看狀態
service mysqld start
service mysqld stop
service mysqld restart
service mysqld status
systemctl start mysqld
service mysqld stop
service mysqld restart
systemctl status mysqld
9.測試遠程連接
連接成功!
2. .net core2.1的安裝
參照官方文檔,地址:https://www.microsoft.com/net/learn/dotnet/hello-world-tutorial#install
1.添加yum源
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
2.升級所有包同時也升級軟體和系統內核
sudo yum update
3.安裝.net core
sudo yum install dotnet-sdk-2.1.4
3. nginx的安裝
1.添加nginx源
sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
2.安裝nginx
sudo yum install nginx
3.啟動nginx並設置開機啟動
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
訪問web服務成功