安裝 LAMP
sudo apt-get install lamp-server^ -y
測試 Apache
http://localhost
測試 PHP
sudo nano /var/www/html/info.php
加入以下一行
Then CTRL+X then y and Enter
溜灠器𨧞入:
http://localhost/info.php
安裝 PHPMyAdmin
sudo apt-get install phpmyadmin -y
預設的使用者是phpmyadmin
進入mysql設定root的密碼
Login to mysql
sudo mysql -u root
mysql>
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘new-password’;
增加使用者並取得所有權限﹕
Grant privileges to a new user execute below command in mysql interface: “replace new-user with the name you need”
CREATE USER ‘new-user’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON *.* TO ‘new-user’@’localhost’;
FLUSH PRIVILEGES;
登出sql
exit