【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`
- PHP Laravel for beginners: from zero fly to the heaven !
- 1.Getting started with laravel: To do list project
- 1.Course overview
- 2.Install xampp and editor
- 3. Download and run laravel
- 4. MVC concept
- 5.Website structure and blade template engine
- 6.CRUD concept: create, read, update, and delete
- 7.Create data by Tinker
- 8.Create data by Factories
- 9.Read function
- 10.Create function
- 11.Update function
- 12.Delete function
- 13.Course summary
- Laravel common command line
- Laravel package and function
- Account 1: Laravel default auth function
- Account 2: Laravel register, login, logout
- Payment : Laravel PayPal
- Payment 2: Laravel alipay
- Payment 3: Laravel wechatpay
- Template 1: Laravel adminlte template
- MySQL