赞
踩
终端执行brew install mysql
即可安装,
执行 mysql.server start
启动数据库
使用 netstat -AaLlnW
查看本机所有端口多了3306端口号
使用lsof -i :3306
或者netstat -an | grep 3306
查看对应端口号进程
使用mysql -u root
可连接数据库
使用mysql -u root -p
连接数据库需要输入密码(本地开发暂不使用,如按下述设置了密码需使用此命令连接数据库)
mysql
数据库并修改密码执行use mysql
使用mysql数据库
然后执行alter USER root@localhost IDENTIFIED BY 'root123';
把mysql数据库密码修改为 root123
执行mysql -u root -p
连接数据库输入上述设置的密码,也可连接成功
exit;
使用mysql.server stop
关闭数据库
We’ve installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
To restart mysql after an upgrade:
brew services restart mysql
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/mysql/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
==> httpd
DocumentRoot is /opt/homebrew/var/www.
The default ports have been set in /opt/homebrew/etc/httpd/httpd.conf to 8080 and in
/opt/homebrew/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To restart httpd after an upgrade:
brew services restart httpd
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/httpd/bin/httpd -D FOREGROUND
==> nginx
Docroot is: /opt/homebrew/var/www
The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /opt/homebrew/etc/nginx/servers/.
To restart nginx after an upgrade:
brew services restart nginx
Or, if you don’t want/need a background service you can just run:
/opt/homebrew/opt/nginx/bin/nginx -g daemon off;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。