Category Archives: How to Fix

Get the default value of the field

Get all default values:
Select * from syscolumns c inner join systypes t on c.xusertype=t.xusertype left syscolumns c inner join syscolumns t on c.xusertype=t.xusertype left Join sysproperties p on c.id=p.id and c.colid = p.mallid left join syscomments m on c.default =m.id
 
Get the default value of a single field:
Select * from syscolumns c inner join systypes t on c.xusertype=t.xusertype left syscolumns c inner join syscolumns t on c.xusertype=t.xusertype left Join sysproperties p on c.id=p.id and c.colid = p.mallid left join syscomments m on c.default =m.id where objectProperty (c.id,’IsUserTable’)=1 and object_name(c.id) = ‘T_good’ and objectProperty (c.id) = ‘T_good’ and C.name = ‘field name’
 

Set the default time to the current value in MySQL

Mysql> create a table by adding this column and stating default values as follows:

CREATE TABLE `table1` (
  `id` int(11) NOT NULL,
  `createtime` timestamp NULL default CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

If you are operating under Navicat, set the field type to TIMESTAMP, and write CURRENT_TIMESTAMP as the default value, as shown below:

Add a new column to an existing table

ALTER TABLE table1
ADD COLUMN  `createtime` timestamp NULL DEFAULT CURRENT_TIMESTAMP

3. Modify the time format of a column and add the default value

alter table table1 
 change createtime newtime timestamp null default current_timestamp

MySQL uses net start MySQL startup prompt (failed to start, the service did not report any error)

Is there a data folder in the root directory of the MySQL installation?The data folder cannot be created manually because there is no data file for the manual creation. You need to use the following command
Mysqld — the initialize – insecure
Initialize the data files under dataDir, and then a data folder will appear under the root directory of the installation, which will contain a bunch of files
If an error occurs during this process, follow the following steps to re-execute it
First uninstall the service using the mysqld — remove command
Then install it using the mysqld — install command
I then initialize it using mysqld –initialize-insecure

Windows command to start MySQL “system error 5”

System error 5 occurred and access was denied when MySQL was restarted in CMD, as shown below:

This error is caused by insufficient permissions to operate CMD. The solution is as follows:
Enter CMD in the search bar of the start menu, right-click the search results, and select run as administrator!

If the frequency of CMD use is high, the following is a once-and-for-all method:
1. Right click on Cmd and select “Attend to Start Menu (U)” to find Cmd in Start Menu.
2. Right-click to select properties, select shortcut, then select advanced, select to run as administrator, and then click OK!
Just open the Start menu and click the shortcut above to run CMD as an administrator!
Net start mysql = net start mysql = net start mysql
 
 
In addition, some prompt that the server name is invalid

 
Different MySQL may have different names
Therefore, it needs to be modified to
Net start MySQL56
 
 
 

Differences between Java and kotlin access modifiers

modifiers

Java

Kotlin

public

all kind of visible

all kind of visible (the default)

private

current class visible

current class visible

prote Cted

the current class, subclass, class is visible under the same package path

the current class, subclass visible

default

class visible (the default) under the same package path

no

internal

no

class is visible in the same module

Su – MySQL switch user, display error: resource temporarily unavailable

The problem
Mysql> su -mysql -mysql>

su: failed to execute /bin/bash: Resource temporarily unavailable

To solve
/etc/securitymits. D ,
, <>> mysq. conf> code>, mysq.>f>

mysql soft nofile 131072
mysql hard nofile 131072
mysql soft nproc 65535
mysql hard nproc 65535

Limits. D overwrites the Limits.
oblem solved.
Information about the description file limits. Conf can look at this article:
https://blog.csdn.net/fanren224/article/details/79971359