Giter Club home page Giter Club logo

yii-book's Introduction

YII 开发的一个简单图书管理系统

1.先克隆代码

先打开命令行,一次输入下面命令

> cd ~/Desktop

> git clone [email protected]:Pupupupure/yii-book.git

2.下载依赖

在项目根目录的命令行输入:

> cd  ~/Desktop/yii-book
> composer install

3.先执行mysql语句创建图书表

  CREATE TABLE `yii2basic`.`books` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(45) NOT NULL,
    `price` VARCHAR(45) NULL,
    `author` VARCHAR(45) NULL,
    `imgUrl` VARCHAR(400) NOT NULL COMMENT '图书封面',
    `description` VARCHAR(300) NULL,
    PRIMARY KEY (`id`));

4.修改连接数据库配置

打开 config -> db.php 文件,设置数据库帐号密码

5启动服务

在项目根目录的命令行输入:

> php yii serve

6.打开浏览器

1.打开地址: http://localhost:8080/index.php?r=site%2Flogin

2.账号:admin 密码:admin

注意事项

如果提示下图错误,可能是mysql8新的加密方式的原因。 连接数据库错误

在 /usr/local/etc/my.cnf 文件中,加入下面这行。

default_authentication_plugin=mysql_native_password

必须新建一个账号,可以参考这个网址( https://faceghost.com/article/515681 ),不然用之前的还是用不了,记得改 config/db.php配置

效果

主页 管理

yii-book's People

Contributors

chunjiangdd01 avatar

Watchers

James Cloos avatar Pure avatar

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.