Ubuntu 18.0环境搭建
【B端后端代码-BBB】
应用框架:Laravel
参考链接:https://www.jianshu.com/p/206592c78113
框架结构:
BBB->项目目录
–app->应用文件目录(控制器、模型[自动以目录])
—Console->
—Events->
—Exceptions->
—Http->控制器文件目录
----Controllers->控制器文件夹
----Middleware->中间件
----Requests->
—Jobs->
—Listeners->
—Providers->
–bootstrap->引导启动文件目录
–config->配置文件目录
–database->数据库操作目录(数据迁移、种子文件)
—factonries->工厂类文件夹
—migrations->迁移文件夹
—seeds->种子文件夹
–libraries->
–public->入口文件、系统静态资源所在目录
—index.php->入口文件
–resoures->视图文件目录
—views->视图文件夹
–routes->路由目录
–storage->缓存文件、日志文件、上传文件目录
–tests->php单元测试目录
–vendor->第三方类库文件、autoload.php类库自动加载
—fzaninotto->数据生成
----faker->一般用于假数据生成
---laravel->源码
--env文件(设置系统相关的环境变量)
【环境配置】
[服务安装]
sudo /etc/init.d/nginx start
sudo /etc/init.d/php7.2-fpm restart
sudo /etc/init.d/mysql start
[服务卸载]
sudo apt-get remove --purge nginx-*
sudo apt-get remove --purge php-*
sudo apt-get remove --purge mysql-*
【mysql安装】
参考链接:
https://segmentfault.com/a/1190000014671905
https://www.cnblogs.com/super-zhangkun/p/9435974.html
https://blog.csdn.net/sinat_21302587/article/details/76870457
https://www.2cto.com/database/201710/691335.html
[安装服务]
- sudo apt-get install mysql-server
- sudo apt-get install mysql-client
- sudo apt-get install libmysqlclient-dev
检查安装
ps aux|grep mysql
修改密码(安装服务时如不提示设置密码,请用以下方法)
sudo vim /etc/mysql/debian.cnf
[client]
host = localhost
user = debian-sys-maint
password = 8DcEiTOgEGEjDqyL
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = 8DcEiTOgEGEjDqyL
socket = /var/run/mysqld/mysqld.sock
默认登录(拷贝以上用户名、密码)
mysql -udebian-sys-maint -p8DcEiTOgEGEjDqyL
show databases;
use mysql;
update user set authentication_string=PASSWORD(“自定义密码”) where user=‘root’;
update user set plugin=“mysql_native_password”;
flush privileges;
quit;
重启服务
/etc/init.d/mysql restart;
再次登录
mysql -u root -p 密码;
ok
[mysql远程链接]
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
将bind-address = 127.0.0.1,修改为:0.0.0.0或者注释掉
mysql -uroot -proot
user,password可以设置成自己的
GRANT ALL PRIVILEGES ON . TO ‘user’@’%’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
#GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘root’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
上一篇: Struts2环境搭建
下一篇: 1.域控制器中五个角色基础