apt install nmap
apt install net-tools (內含ifconfig)
apt install tasksel
執行tasksel 選擇安裝LAMP SERVER (mysql 5.7 php 7.2)
安裝過程中沒有輸入 mysql 密碼的選項??
如何重設mysql密碼
https://linuxconfig.org/how-to-reset-root-mysql-password-on-ubuntu-18-04-bionic-beaver-linux
跟著文章做,下這指令時SET PASSWORD FOR root@'localhost' = PASSWORD('linuxconfig.org');出現錯誤
ERROR 1524 (HY000): Plugin 'auth_socket' is not loaded
參考https://stackoverflow.com/questions/37879448/mysql-fails-on-mysql-error-1524-hy000-plugin-auth-socket-is-not-loaded
use mysql; # use mysql table
update user set authentication_string=PASSWORD("") where User='root'; # update password to nothing
update user set plugin="mysql_native_password" where User='root'; # set password resolving to default mechanism for root user
flush privileges;
再下指令:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('linuxconfig.org');
即可
另一個方法
https://itw01.com/GBSY3E3.html
mysql_secure_installation
第一個提示會問你是否想要設定驗證密碼外掛,它可以用來測試你的MySQL密碼的強度。 無論您選擇什麼,下一個提示將是為MySQL 根使用者設定密碼。 輸入並確認您選擇的安全密碼。 原文網址:https://itw01.com/GBSY3E3.html
另一個方法
https://www.peterdavehello.org/2019/12/set-mysql-password-login-and-create-database-on-ubuntu-18-04-and-later/
mysql mysql 進到 MySQL 後透過 SQL 語法查詢:
https://www.peterdavehello.org/2019/12/set-mysql-password-login-and-create-database-on-ubuntu-18-04-and-later/
mysql mysql 進到 MySQL 後透過 SQL 語法查詢:
mysql> SELECT user, authentication_string, plugin, host FROM mysql.user WHERE user = 'root';
以上查詢會得到這樣的結果,可以看到 root 使用 auth_socket
plugin 且 authentication_string
為空:
+------+-----------------------+-------------+-----------+ | user | authentication_string | plugin | host | +------+-----------------------+-------------+-----------+ | root | | auth_socket | localhost | +------+-----------------------+-------------+-----------+ 1 row in set (0.00 sec)
這邊透過ALTER
語法把 root 登入的方式改為密碼驗證,在最後password
的地方改為自己要設定的密碼即可:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.06 sec)
再次透過同樣的 SELECT
語法確認,可以看到 authentication_string
已經有密碼的雜湊值、plugin
已經從 auth_socket
變為 mysql_native_password
:
mysql> SELECT user, authentication_string, plugin, host FROM mysql.user WHERE user = 'root'; +------+-------------------------------------------+-----------------------+-----------+ | user | authentication_string | plugin | host | +------+-------------------------------------------+-----------------------+-----------+ | root | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 | mysql_native_password | localhost | +------+-------------------------------------------+-----------------------+-----------+ 1 row in set (0.00 sec)
這時就可以做FLUSH PRIVILEGES
的操作讓上述修改生效:
mysql> FLUSH PRIVILEGES;
再執行exit
或quit
指令結束這次的 MySQL 操作,準備實際測試看看是不是已經不能直接透過系統的 root 身份登入 MySQL 、而是必須透過密碼的方式進行驗證
mysql -u root -p
SAMBA SERVER
OPENSSH SERVER
apt install phpmyadmin
安裝php5.6
http://dchesmis.blogspot.tw/2016/09/ubunt-1604php5x.html
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
sudo php -v
另一篇文章 安裝擴展
sudo apt-get install php5.6-gd
sudo apt-get install php5.6-mysql php5.6-curl
在php5與php7間切換
從 php5 切換到 php7.2 :
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.2 ; sudo service apache2 restart
CLI:
update-alternatives –set php /usr/bin/php7.2
從 php7 切換到 php5:
sudo a2dismod php7.2 ; sudo a2enmod php5.6 ; sudo service apache2 restart
CLI:
sudo update-alternatives –set php /usr/bin/php5.6
安裝中文輸入法
apt-get install scim scim-tables-zh