Mysql Download for Mac Os X 10.6.8
Get your Local Web Development Environs Upward & Running on macOS Big Sur 11 and Catalina 10.15
With Apples' new macOS Large Sur 11 bachelor for download, hither is how to get the AMP stack up and running on the new macOS. This tutorial volition go through the process of getting Apache, MySQL, PHP (or otherwise known as the 'AMP' stack) and phpMyAdmin running on the new mac Os Big Sur.
This guide will as well work on macOS Catalina and Mojave.
This tutorial sets up the AMP stack in more than of a traditional way using the loaded Apache and PHP and downloading MySQL and phpMyAdmin.
Apache/WebSharing
Web serving is congenital into Large Sur with Apache app, it is installed ready to be fired upwardly.
This needs to exist done in the Last which is found in the OS filing organization at /Applications/Utilities/Terminal
For those non familiar with the Terminal, it actually isn't as intimidating as you may remember, once launched you are faced with a command prompt waiting for your commands - only type/paste in a command and hit enter, some commands give y'all no response - it merely ways the command is done, other commands give you feedback.
Using the prefix of sudo is required for commands that have their applications protected in specific folders - when using sudo you will need to ostend with your admin password or iCloud password if set up that way.... let'south get to it ...
to get-go Apache web sharing
sudo apachectl commencement
to stop it
sudo apachectl terminate
to restart it
sudo apachectl restart
To observe the Apache version
httpd -5
The Apache version that comes in macOS Big Sur is Apache/ii.4.46
After starting Apache - test to see if the webserver is working in the browser - http://localhost - you lot should see the "It Works!" text.
If you lot don't go the localhost test, you tin can effort troubleshooting Apache to see if at that place is anything wrong in its config file by running
apachectl configtest
This will give you an indication of what might be wrong.
Document Root
Certificate root is the location where the files are shared from the file organisation and is like to the traditional names of 'public_html' and 'htdocs', macOS has historically had 2 web roots i at a system level and one at a user level - you tin can set both upward or just run with ane, the user level one allows multiple accounts to have their own web root whilst the system 1 is global for all users. It seems there is less effort from Apple in continuing with the user level one but it all the same can be fix with a couple of extra tweaks in configuration files. It is easier to apply the user level one equally you don't have to keep on authenticating as an admin user.
System Level Web Root
- the default arrangement certificate root is still found at -
http://localhost/
The files are shared in the filing system at -
/Library/WebServer/Documents/
User Level Root
The other web root directory which is missing by default is the '~/Sites' binder in the User account. This takes a chip longer to set up simply some users are very accustomed to using it.
You need to brand a "Sites" binder at the root level of your account and then it will work. Once you brand the Sites folder you will detect that it has a unique icon which is a throwback from a few versions older. Make that folder before you lot set up the user configuration file described next.
Yous take to brand a few boosted tweaks to get the ~/Sites folder back up and running.
Add a "username.conf" filed under:
/etc/apache2/users/
If y'all don't already take one (very probable), so create one named past the short username of the account with the suffix .conf, its location and permissions/buying is all-time tackled by using the Final, the text editor 'nano' would exist the all-time tool to bargain with this.
If you would rather edit config files in a text editor as an app I would suggest text editor like the gratis BBEdit which allows you to open hidden organisation files.
Launch Final, (Applications/Utilities), and follow the commands below, first 1 gets yous to the right spot, 2nd one opens the text editor on the command line (swap 'username' with your account's shortname, if you don't know your account shortname blazon 'whoami' the Concluding prompt):
cd /etc/apache2/users
sudo nano username.conf
So add the content below swapping in your 'username' in the code beneath, in that location is a slightly different user directive for Big Sur and Catalina, make sure 'Require host localhost' is used:
<Directory "/Users/username/Sites/"> AllowOverride All Options Indexes MultiViews FollowSymLinks Require host localhost </Directory>
Permissions on the file should be:
-rw-r--r-- 1 root wheel 298 Jun 28 sixteen:47 username.conf
If non, you lot need to change it...
sudo chmod 644 username.conf
Open the main httpd.conf and allow some modules:
sudo nano /etc/apache2/httpd.conf
And make sure these modules are uncommented (the showtime 2 should already exist on a clean install):
LoadModule authz_core_module libexec/apache2/mod_authz_core.then
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
While y'all have this file open as well to get php running, uncomment the below ... (Mentioned also in the PHP role of the article).
LoadModule php7_module libexec/apache2/libphp7.so
And also uncomment this configuration file also in httpd.conf - which allows user home directories.
Include /private/etc/apache2/extra/httpd-userdir.conf
Save all your changes (Command + O in nano)
Then open some other Apache config file and uncomment another file:
sudo nano /etc/apache2/extra/httpd-userdir.conf
And uncomment:
Include /private/etc/apache2/users/*.conf
Save all your changes (Control + O in nano)
Restart Apache for the new file to exist read:
sudo apachectl restart
Then this user level document root will be viewable at:
http://localhost/~username/
You should simply see a directory tree like construction if the binder is empty.
Override .htaccess and allow URL Rewrites
If yous are going to use the web serving document root at /Library/WebServer/Documents it is a skillful thought to allow whatever .htaccess files used to override the default settings - this tin be achieved past editing the httpd.conf file at line 217 and setting the AllowOverride to All and and so restart Apache. This is already taken care of at the Sites level webroot by following the previous step.
sudo nano /etc/apache2/httpd.conf
As well while here allow URL rewrites and so your permalinks wait clean, not ugly.
Uncomment in httpd.conf - should be uncommented on a clean install.
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
PHP
PHP seven.three.24 is loaded in this version of macOS Big Sur and needs to be turned on by uncommenting a line in the httpd.conf file.
sudo nano /etc/apache2/httpd.conf
Apply "control" + "west" to search within nano and search for 'php' this volition land you lot on the right line so uncomment the line (remove the #):
LoadModule php7_module libexec/apache2/libphp7.so
Write out and Salvage using the nano shortcut keys at the lesser 'control o' and 'control x'
Reload Apache to kicking in
sudo apachectl restart
To run across and examination PHP, create a file proper noun information technology "phpinfo.php" and file information technology in your document root with the contents below, then view information technology in a browser.
<?php phpinfo(); ?>
Hither you will see that Apple are not intending on bundling PHP in the macOS in the future, mayhap with the next incarnation of the OS, only for now it'southward working albeit not version seven.4. Nonetheless you can use a Homebrew PHP solution that allows for any PHP version to exist used.
[email protected] Documents % php -v WARNING: PHP is not recommended PHP is included in macOS for compatibility with legacy software. Future versions of macOS will not include PHP. PHP 7.three.24-(to be removed in time to come macOS) (cli) (congenital: Dec 21 2020 21:33:25) ( NTS ) Copyright (c) 1997-2018 The PHP Grouping Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
MySQL
MySQL doesn't come pre-loaded with macOS Large Sur and needs to be dowloaded from the MySQL site.
The latest version of MySQL 8.0.23 does work with the latest release of macOS.
Use the macOS 10.15 (x86, 64-bit), DMG Annal version (works on macOS Big Sur).
If you are upgrading from a previous macOS and have an older MySQL version you lot practise not accept to update it.
Also if you have a clean install and desire the earlier MySQL version 5.7, you lot can still go this from the MySQL site - from the 'Looking for previous GA versions' link. (MySQL 8 is relatively new and not in many production set ups)
One thing with MySQL upgrades, always take a data dump of your database in case things go south and earlier y'all upgrade to macOS Catalina make sure your MySQL Server is not running.
When downloading yous don't have to sign up, wait for » No thanks, just commencement mydownload - become direct to the download.
One time downloaded open up the .dmg and run the installer.
During the MySQL procedure you are prompted to cull between strong and legacy countersign encryptions, since version 8 is entirely new, some software like phpMyAdmin tin't connect with the newer encryptions - so if you are going to use a GUI wrapper like phpMyadmin I propose you stick to legacy.
Then add a countersign for the MySQL root user.
Add Mysql to your path
Afterwards installation, in social club to utilize MySQL commands without typing the full path to the commands you need to add the mysql directory to your shell path, (optional stride) this is washed in your Zsh crush profile ".zshrc" file in your dwelling directory (previous shells were bash ), if yous don't accept that file just create it using half dozen or nano:
cd ; nano .zshrc
export PATH="/usr/local/mysql/bin:$PATH"
The showtime command brings y'all to your dwelling directory and opens the .zsh file or creates a new one if it doesn't exist, so add together in the line above which adds the MySQL binary path to commands that you lot can run. Exit the file with type "control + x" and when prompted to save the change by typing "y". The concluding thing to do here is to reload the shell for the in a higher place to work straight away.
source ~/.zshrc
Alter the MySQL root password
(This section is left in for reference - in previous macOS MySQL packages the password set during the installation process would fail - hence the info below. This newer version, however, seems to work).
Notation that this is not the aforementioned as the root or admin password of macOS - this is a unique password for the MySQL root user.
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server terminate
Offset it in safety mode:
sudo mysqld_safe --skip-grant-tables
This will be an ongoing control until the process is finished so open another trounce/final window, and log in without a password as root:
mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED By 'MyNewPass';
Change the lowercase 'MyNewPass' to what you want - and keep the single quotes.
\q
First MySQL
sudo /usr/local/mysql/support-files/mysql.server beginning
Starting MySQL
You lot can then beginning the MySQL server from the System Preferences adds to the final row or via the command line.
The new MySQL system preference also has the uninstall feature - useful if you've installed it with a security encryption that's not working for you and desire to try the other ane. You can besides see the paths to the config and data sources of MySQL in the configuration tab.
Or to Command line start MySQL.
sudo /usr/local/mysql/support-files/mysql.server kickoff
To notice the MySQL version from the terminal, blazon at the prompt:
/usr/local/mysql/bin/mysql -five -uroot -p
This as well puts y'all into a shell interactive dialogue with MySQL, type \q to get out.
Ready the 2002 MySQL Socket fault
Set up the looming 2002 socket error - which is linking where MySQL places the socket and where macOS thinks it should be, MySQL puts it in /tmp and macOS looks for information technology in /var/mysql the socket is a type of file that allows MySQL client/server communication.
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
phpMyAdmin
First ready the 2002 socket error if you lot haven't done so from the MySQL section-
sudo mkdir /var/mysql
sudo ln -south /tmp/mysql.sock /var/mysql/mysql.sock
Download phpMyAdmin, the zip English package will suit a lot of users, and then unzip it and movement the folder with its contents into the certificate root level renaming binder to 'phpmyadmin'.
Make the config binder
mkdir ~/Sites/phpmyadmin/config
Change the permissions
chmod o+w ~/Sites/phpmyadmin/config
Run the ready in the browser
http://localhost/~username/phpmyadmin/setup/ or http://localhost/phpmyadmin/setup/
You need to create a new localhost mysql server connexion, click new server.
Switch to the Authentication tab and fix the local MySQL root user and the countersign.
Add in the username "root" (possibly already populated, add together in the password that you lot ready upwards earlier for the MySQL root user fix, click on save and you are returned to the previous screen.
(This is not the macOS Admin or root password - it is the MySQL root user)
Now going to http://localhost/~username/phpmyadmin/ will now allow you to interact with your MySQL databases.
Permissions
To run a website with no permission bug it is best to prepare the web root and its contents to be writeable past all since it's a local development information technology shouldn't be a security issue.
Let's say that you have a site in the User Sites folder at the following location ~/Sites/testsite you would set information technology to be writeable like so:
sudo chmod -R a+west ~/Sites/testsite
If you are concerned nigh security then instead of making information technology world writeable yous can set the owner to exist Apache _www simply when working on files you would accept to authenticate more equally admin you are "not" the owner, you would practise this like so:
sudo chown -R _www ~/Sites/testsite
This will set the contents recursively to exist owned by the Apache user.
If you had the website stored at the System level Document root at say /Library/WebServer/Documents/testsite then information technology would take to be the latter:
sudo chown -R _www /Library/WebServer/Documents/testsite
Another more than straightforward way to do this if you accept a one user workstation is to change the Apache web user from _www to your account.
That'southward it! You now have the native AMP stack running on top of macOS Large Sur or Catalina.
To fix vritual hosts aka vhosts on Apache check the guide here.
If y'all are a WordPress user and want a smooth lean local development environment - also worth checking out is Laravel Valet which runs on top of macOS - check out my Valet WordPress Guide on macOS.
Mysql Download for Mac Os X 10.6.8
Posted by: holmbrover1940.blogspot.com