Install PHP
sudo yum update -y
sudo amazon-linux-extras install -y php7.3
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl is-enabled httpd
sudo systemctl restart httpd
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
Install MYSQL 5.7
1. sudo yum update -y
2. sudo wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
3. sudo yum localinstall mysql57-community-release-el7-11.noarch.rpm
4. sudo yum install mysql-community-server
5. sudo systemctl start mysqld.service
or
sudo service mysqld start
or
sudo service mysqld status
6. To get the default password
sudo grep 'temporary password' /var/log/mysqld.log
7. mysql -u root -p
8. Change the password
mysql_secure_installation
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.
- Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
9. Restart service
systemctl restart mysql
10. Then connect to MySQL and create user and grand all privilege to all database
[ec2-user@ip- etc]$ mysql -u root -p
Enter password:
mysql> GRANT ALL ON *.* TO rahul@'%' IDENTIFIED BY "Rahul@Test123";
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Comments
Post a Comment