Category: MySQL 8.0
-
Post Views: 17 1. Verify the fields that conform to the MySQL field type Decimal(8,2) in Lavavel 9. as shown in Figure 1 2. The final realization is as follows 3. Try respectively: -4 (fail), 0 (success), 5 (success), 999999.99 (success), 999999.990 (success), 999999 .991 (failed), 9999990.99 (fail), 0.09 (success), 0.009 (fail), 0.0000001 (failed), in line with expectations. as shown…
-
Post Views: 17 1. Execute the database migration error in Laravel 9: sqlstate[HY000]: General error: 1366 Incorrect decimal value:0for columnat row -1. as shown in Figure 1 2. Copy the error-reported sql to Navicat for MySQL to execute, but still report the error: 1366 – Incorrect decimal value:0for columnat row -1. as shown in Figure 2 3. Check the code…
-
Post Views: 21 1. In MySQL 8, the IN condition is used for multiple fields, and the query result is empty. as shown in Figure 1 2. Reference:In MySQL 8, the in condition is used for multiple fields The query result is not empty for sql as follows 3. Reference:Error when using native expression query in Laravel 9: SQLState[42000]: syntax…
-
Post Views: 17 1. Reference:In MySQL 8.0, when querying the total number of table records, the analysis optimization of the timeout. The execution time in Navicat is: 3.075 seconds. as shown in Figure 1 2. The execution time in Laravel 9 is: 60317.74ms. It is equivalent to 60 seconds. as shown in Figure 2 3. Verify another count(*) SQL, the…
-
Post Views: 17 1. Reference: In mysql 8.0, when the total number of table records is checked, the analysis and optimization of the timeout is optimized. Add WHERE ID > 0 when a COUNT SQL does not exist where condition exists. 2. Reference:How to check if table is already has a where Clause in Laravel Query Builder? The final implementation…
-
Post Views: 24 1. An interface request response timeout, because count(*) SQL takes 54 seconds. The amount of data in the table exceeds 10 million. as shown in Figure 1 2. The table field Shipping_Type has an index to add, and its value is only 1 and 2 possibilities. Decide to add the where condition Shipping_Type in (1,2). The query…
-
Post Views: 15 1. There is no primary key ID of the A table in the B table, but there are 2 other fields of the A table. Now plan to query the records in the A table based on the other 2 fields of the A table. Plan to use in conditions. The general standard usage is shown below…
-
Post Views: 18 1. In PHP, insert the JSON string (the Chinese has been encoded) into MySQL, and the Chinese has been encoded. as shown in Figure 1 2. Try to url decode the entire JSON string directly. Instead of converting JSON to an array, then traversing the array, url decoding each value, and finally encode the array into a…
-
Post Views: 16 1. Set the default value of DateTime in MySQL 8.0 to be0000-00-00 00:00:00Time error: sqlstate[42000]: Syntax error or access Violation: 1067 Invalid default value forOPERATED_AT_GMT. as shown in Figure 1 2. Reference:https://www.shuijingwanwq.com/2022/09/28/6993/In Navicat for MySQL, when the table is copied from one database to another, an error is reported:[ERR]1292 – Incorrect DateTime Value: ‘0000-00-00 00:00:00’ for column…
-
Post Views: 18 1. After downloading the installation package of MySQL 8.0, start the installation. The process prompts: Select products to upgrade. using this wizard you will be able to update your installed products. upgradeable products. MySQL Server can be upgraded from 5.7.19 to 5.7.44. Can’t upgrade to 8.0. as shown in Figure 1 2. Decide to back up the…