首页 » 后端 » Laravel » 正文

laravel 环境配置手记

发布者:站点默认
2019/07/30 浏览数(743) 分类:Laravel, MySQL/MariaDB, Windows laravel 环境配置手记已关闭评论

设置镜像源

# 国内源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

# 恢复到默认的官方源
# composer config -g --unset repos.packagist

composer 源切换工具

composer global require slince/composer-registry-manager
composer repo:ls
composer repo:use huawei

替换包地址中的 git:// 为 https://

composer config --global github-protocols https
# git config --global url."https://".insteadOf git://
# yarn 和 npm 的设置方法不详

刷新 composer.lock 文件

composer update --lock
# --lock  Only updates the lock file hash to suppress warning about the lock file being out of date.
# 换源后可以用这个更新 composer.lock 中的旧源链接

Windows 下 MySQL 8 的初始化

mysqld.exe --initialize --console --default-authentication-plugin=mysql_native_password
#...
#...[Server] A temporary password is generated for root@localhost: tq3-aP)Po%E=
#...

mysqld --install
# Service successfully installed.

net start mysql
# MySQL 服务正在启动 ...
# MySQL 服务已经启动成功。

mysqladmin -uroot -p PASSWORD
# Enter password: tq3-aP)Po%E=
# New password: ******
# Confirm new password: ******
# Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

CREATE DATABASE cms DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci;
# Query OK, 1 row affected (0.05 sec)
点击返回顶部
  1. 留言
  2. 联系方式