Configure the PHP + MySql environment on Mac. mantis needs to be configured recently for bug tracking, and the process is recorded here. Because the PHP apache environment is built-in on Mac OS, you do not need to install the installation package in another place. You just need to configure it briefly. First, open the terminal and enter the command: sudo vim/etc/apache2/httpd. conf. One line is like this # LoadModule php5_module libexec/apache2/libphp5.so www.2cto.com to remove. Enable sharing in the system preference settings to hook up web Sharing, as shown in figure
Restart apache. Run the following command: sudo apachectl restart to enter http: // localhost/in the browser. If It works appears! It indicates that the MySql environment is successfully configured under the php environment. First download the dmg installation package of MySql. In: bytes. In this way, the installation is successful. Enable mysql in the system preference settings and enable the service. After installation, the default user name is root and the password is blank. For security, set a password. Open the terminal. If you enter mysql to prompt that this command is not available, configure the environment variable in the mysql bin directory. Directory:/usr/local/mysql/bin/. Add it to the PATH variable. Here I will introduce another method, enter sudo vim/etc/bashrc www.2cto.com in the terminal and add # mysqlalias mysql = '/usr/local/mysql/bin/mysql' alias mysqladmin = '/usr/local/ mysql/bin/mysqladmin, enter mysql in the terminal to run this command. In fact, it is similar to the macro definition in C/C ++, and alias is used instead. Next, modify the root password and run the following command: mysqladmin-uroot password 12345 to change the root password to 12345. to manage Mysql, It is troublesome to use command lines. The open-source phpMyAdmin adopts the C/S Mode for convenient management. Then we will install phpMyAdmin. it was developed by php and is: www.2cto.com cp config. sample. inc. php config. inc. phpvim config. inc. modify php as follows: $ cfg ['blowfish _ secret'] = ''; // used for Cookie encryption, random long string $ cfg ['servers'] [$ I] ['host'] = '2017. 0.0.1 '; // IP address bound to the MySQL daemon. You can enter the URL in the browser: http :/ /Localhost/phpmyadmin/use the server name: root Password to set the password for you. You can log in to the mysql management interface. Author fengyv