01 Oct 2017

[备忘] Laravel+Mysql配置

Laravel+Mysql配置备忘

1.laravel安装

composer install
sudo chmod -R 777 storage
sudo chmod -R 777 bootstrap
composer  dump-autoload
php artisan key:generate
php artisan migrate:refresh //先创建好db,用来第一次建数据库表的,这个命令会清空数据表

2.mysql 2002错误解决办法

unset TMPDIR
bash mysql_install_db --verbose --user=root
--basedir="$(brew --prefix mysql)"--datadir=/usr/local/var/mysql --tmpdir=/tmp
sudo brew services start mysql
sudo chown -R _mysql /usr/local/var/mysql
sudo chmod -R o+rwx /usr/local/var/mysql