mac系统中如何利用命令框里进行数据库迁移
2017-04-08 22:36
519 查看
第一步:将要迁移的数据库sql文件放置项目根目录下,例如要把sql文件3laoshi.sql倒入到新建的数据库3laoshi。
第二步:ls查看根目录下文件
DantedeMac-mini:sites tianjingang$ ls
3laoshi.sql admin admin.sql
admin副本 blog
第三步 :执行mysql -uroot -p 3laoshi<3laoshi.sql;然后敲回车,输入数据库密码。
DantedeMac-mini:sites tianjingang$ mysql -uroot -p 3laoshi<3laoshi.sql
Enter password:
第四步:进入项目根目录,执行php artisan migrate命令。查看返回结果。
DantedeMac-mini:sites tianjingang$ cd admin
DantedeMac-mini:admin tianjingang$ php artisan migrate;
Migration table created successfully.
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2017_02_21_152559_create_permissions_table
Migrated: 2017_02_21_152559_create_permissions_table
Migrating: 2017_04_01_173551_create_admins_table
Migrated: 2017_04_01_173551_create_admins_table
Migrating: 2017_04_01_180959_create_roles_table
Migrated: 2017_04_01_180959_create_roles_table
Migrating: 2017_04_03_135849_create_votes_table
Migrated: 2017_04_03_135849_create_votes_table
Migrating: 2017_04_03_135900_create_vote_questions_table
Migrated: 2017_04_03_135900_create_vote_questions_table
Migrating: 2017_04_03_135910_create_vote_results_table
Migrated: 2017_04_03_135910_create_vote_results_table
Migrating: 2017_04_05_120024_add_grades_to_lives_table
Migrated: 2017_04_05_120024_add_grades_to_lives_table
第五步:执行php artisan db:seed命令,进行数据库迁移
DantedeMac-mini:admin tianjingang$ php artisan db:seed;
Seeding: RoleTableSeeder
Role table seeded!
第二步:ls查看根目录下文件
DantedeMac-mini:sites tianjingang$ ls
3laoshi.sql admin admin.sql
admin副本 blog
第三步 :执行mysql -uroot -p 3laoshi<3laoshi.sql;然后敲回车,输入数据库密码。
DantedeMac-mini:sites tianjingang$ mysql -uroot -p 3laoshi<3laoshi.sql
Enter password:
第四步:进入项目根目录,执行php artisan migrate命令。查看返回结果。
DantedeMac-mini:sites tianjingang$ cd admin
DantedeMac-mini:admin tianjingang$ php artisan migrate;
Migration table created successfully.
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrating: 2017_02_21_152559_create_permissions_table
Migrated: 2017_02_21_152559_create_permissions_table
Migrating: 2017_04_01_173551_create_admins_table
Migrated: 2017_04_01_173551_create_admins_table
Migrating: 2017_04_01_180959_create_roles_table
Migrated: 2017_04_01_180959_create_roles_table
Migrating: 2017_04_03_135849_create_votes_table
Migrated: 2017_04_03_135849_create_votes_table
Migrating: 2017_04_03_135900_create_vote_questions_table
Migrated: 2017_04_03_135900_create_vote_questions_table
Migrating: 2017_04_03_135910_create_vote_results_table
Migrated: 2017_04_03_135910_create_vote_results_table
Migrating: 2017_04_05_120024_add_grades_to_lives_table
Migrated: 2017_04_05_120024_add_grades_to_lives_table
第五步:执行php artisan db:seed命令,进行数据库迁移
DantedeMac-mini:admin tianjingang$ php artisan db:seed;
Seeding: RoleTableSeeder
Role table seeded!
相关文章推荐
- 如何利用php array_multisort函数 对数据库结果进行复杂排序
- 数据库事务的四大特性、隔离级别以及Spring中如何利用AOP进行事务管理
- 利用RMAN将数据库从文件系统迁移到ASM
- 如何把数据库系统迁移到 DB2 9
- 如何利用微信预约系统进行驾校教练学车的预约
- Mac系统下利用ADB命令连接android手机并进行文件操作
- 利用tox工具对keystone在py27下进行单元测试,如何让其在非本地数据库执行
- 管理员如何执行WCM内容内在Portal系统之间进行内容与配置迁移
- Mac系统下利用ADB命令连接android手机并进行文件操作
- 如何通过RMAN进行裸设备和文件系统之间的数据文件迁移
- 如何将数据库从文件系统迁移到ASM存储里
- HTML提交表单用户选择的头像如何利用<select>标签提交到PHP并连接数据库进行存读操作
- 利用EXP/IMP进行数据迁移,如何转换表空间操作(完整版)
- Win10系统如何查看Mac地址以便进行Mac地址过滤
- 如何利用spotlight for unix对linux进行系统性能监控
- 缓存测试分享篇:如何利用测试环境进行灰度测试缓存迁移solo
- 利用dbLink技术 可以进行数据库复制(及如何调整表顺序)
- Mac系统下利用ADB命令连接android手机并进行文件操作