Git Product home page Git Product logo

Comments (4)

mylxsw avatar mylxsw commented on May 27, 2024

连不上数据库,检查下你宿主机上的数据库是否启动了,账号密码权限是否已经分配

from wizard.

mobguang avatar mobguang commented on May 27, 2024

Hi @mylxsw ,

感谢回复。我后来尝试的步骤如下:

  1. 我在主机上通过docker启动了mysql,并且执行了如下mysql的初始化脚本:
    create database wizard default character set utf8mb4 collate utf8mb4_bin ;
    create user 'wizard'@'%' identified by 'wizard' ;
    grant all privileges on wizard.* to 'wizard'@'%' ;
    flush privileges ;

  2. 然后在本机执行了如下脚本:
    docker run -d --name wizard
    -e DB_HOST=10.8.18.87
    -e DB_PORT=3306
    -e DB_DATABASE=wizard
    -e DB_USERNAME=wizard
    -e DB_PASSWORD=wizard
    -p 8080:80
    -v /Volumes/M2SSD/Space/GuangResourcesPool/Guang_workspace/workspace/wizard/content:/webroot/storage/app/public
    mylxsw/wizard

  3. 执行docker exec -it wizard /bin/bash,进入docker;

  4. 执行php artisan migrate:install,遇到如下error:

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: create table migrations (id
int unsigned not null auto_increment primary key, migration varchar(191) not null, batch int not null) default character
set utf8mb4 collate 'utf8mb4_unicode_ci')

请问是哪一步有问题吗,感谢指导!

from wizard.

mylxsw avatar mylxsw commented on May 27, 2024

这是用的 mysql8 吧,这样,修改下用户信息

alter user 'wizard'@'%' identified with mysql_native_password by 'wizard';

from wizard.

mobguang avatar mobguang commented on May 27, 2024

Hi @mylxsw ,

谢谢,可以启动了。

from wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.