The installation will be done in three main steps:
- Install MySQL.
- Install PHP.
- Install WordPress site.
Install MySQL
You can use the following resource to install MySQL on MAC:
After installing it, run create database my_wordpress_site; command to create a database locally to your mysql instance:
Connect to mysql instance first:
mysql -u root -p
mysql> create database my_wordpress_site;
Query OK, 1 row affected (0.03 sec)
Run SHOW SCHEMAS; command to get the list of databases on your mysql instance:
mysql> SHOW SCHEMAS; +-------------------------------+ | Database | +-------------------------------+ | information_schema | | my_wordpress_site | | mysql | | performance_schema | | | sys | +-------------------------------+
You can confirm from the above results that the my_wordpress_site database has been created.
Create a new user for your database:
CREATE USER 'my_wordpress_site_user'@'localhost' IDENTIFIED BY '<NewPasswordForThisUser>';
Grant permissions to that user to your wordpress db.
GRANT ALL ON my_wordpress_site.* TO 'my_wordpress_site_user'@'localhost';
Confirm whether the user has got the permissions for that db:
SHOW GRANTS FOR 'my_wordpress_site_user'@'localhost';
Output will show like this:
+---------------------------------------------------------------------------------------+ | Grants for my_wordpress_site_user@localhost | +---------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO `my_wordpress_site_user`@`localhost` | | GRANT ALL PRIVILEGES ON `my_wordpress_site`.* TO `my_wordpress_site_user`@`localhost` | +---------------------------------------------------------------------------------------+
Install PHP
You can use the following resource to install PHP on MAC
Install WordPress site
Go to https://wordpress.org/download/
Click the download button for the latest version from that site:
![](https://studyraft.com/wp-content/uploads/2022/04/image-143.png)
Extract the zip and unzip to a location say /WordPress/MyWordPressSite on your MAC:
![](https://studyraft.com/wp-content/uploads/2022/04/image-144-1024x876.png)
Open the terminal at the folder (/WordPress/MyWordPressSite):
![](https://studyraft.com/wp-content/uploads/2022/04/image-145-1024x897.png)
Run php -S localhost:9000 command to start the PHP server on that web site at 9000 port
php -S localhost:9000
Output:
PHP 7.4.29 Development Server (http://localhost:9000) started
Accessing http://localhost:9000 will take you to the WordPress set up screen now:
![](https://studyraft.com/wp-content/uploads/2022/04/image-146.png)
Click Let’s go button on the next screen:
![](https://studyraft.com/wp-content/uploads/2022/04/image-150.png)
Enter the following details on tne next page:
- Database Name: my_wordpress_site
- Username: my_wordpress_site_user
- Password: <The password you set for my_wordpress_site_user>
- Database Host: localhost
- Table Prefix: wp_
![](https://studyraft.com/wp-content/uploads/2022/04/image-151-1024x670.png)
Click the Run the installation button on the next page:
![](https://studyraft.com/wp-content/uploads/2022/04/image-152.png)
On Information needed page add the following details:
- Site Title: My WordPress Site
- Username: wp_admin
- Password: <Any strong password> (Save it for future usage)
- Your Email: <Your Email>
- Search engine visibility: Check the checkbox.
![](https://studyraft.com/wp-content/uploads/2022/04/image-153-912x1024.png)
Click the Install WordPress button.
Next page will display a success message to show that the installation has been done:
![](https://studyraft.com/wp-content/uploads/2022/04/image-154-1024x603.png)
Click the Log In button.
On the login page enter your credentials which you added in the WordPress configuration set up.
![](https://studyraft.com/wp-content/uploads/2022/04/image-155.png)
You will be taken to the admin dashboard page of your WordPress site after successfull login.
![](https://studyraft.com/wp-content/uploads/2022/04/image-156-1024x749.png)
The installation is completed now for your WordPress site on MAC.