ubuntu安装LAMP
1.安装apache : sudo apt install apache2 -y
2.安装MySQL : sudo apt install mysql-server mysql-client
3.修改MySQL的root密码:
cd /etc/mysql;
sudo cat debian.cnf
找到用户名和密码, 使用它登录mysql
如: mysql -udebian-sys-maint -pxedvSNKdLavjuEWV
use mysql;
update user set authentication_string=PASSWORD("自定义密码") where user='root';
update user set plugin="mysql_native_password";
flush privileges;
quit
mysql -u root -p 新密码
登录后修改下远程访问:
use mysql;
update user set host='%' where user='root';
4. sudo apt install php-mysql php-curl php-json php-cgi php libapache2-mod-php