企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
【Modify the table name】 `alter table table_name rename table_new_name;` <br/> 【Modify the field name in the table】 ``` ALTER TABLE 表名 CHANGE 旧字段名 新字段名 新数据类型; -- Example ALTER TABLE users CHANGE created_at create_date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP; ``` <br/> 【Add a field + type after a field in the table】 ``` -- Example 1: ALTER TABLE `posts` ADD COLUMN `recycle` int(10) NOT NULL DEFAULT 1 AFTER `content`; -- Example 2: ALTER TABLE `user_table` ADD COLUMN `login_status` bigint(20) DEFAULT 1 AFTER `login_action`; -- Example 3: ALTER TABLE `images` ADD COLUMN `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL AFTER `url`; -- Example 4: ALTER TABLE `users` ADD COLUMN `unix_time` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '' AFTER `password`; ``` <br/> [Modify MySQL Password] After logging in to mysql: `set password for 用户名@localhost = password('新密码');` Example: `set password for root@localhost = password('123456'); ` <br/> [large sql import] The test target is 2G (1) phpmyadmin can be adjusted, but there will be various restrictions on the adjustment (2) cmd import: Open the my.ini file in the MySQL installation directory, add max_allowed_packet, and set the target size, such as 10000M: `max_allowed_packet = 10000M` <br/> Restart the MySQL service in the service, check whether the modification is successful in the command line window (command: `show VARIABLES like '%max_allowed_packet%';`) <br/> Import the sql file in mysql using the source command (source sql file path) `source C:\wamp64\bin\mysql\mysql5.7.19\bin\target.sql` <br/> [laravel modify the running domain name]: `php artisan serve --port=8888`