A small-sized universal electronic lock adopting a driving mechanism, wherein the driving mechanism comprises a driving member used to be connected with an external lock cylinder and a motor assembly used for driving the driving member to move so as to drive the external lock cylinder to rotate; the motor assembly comprises a motor and a gear assembly, and the motor is disposed on a side of the driving member; and the gear assembly is located on front ends of the motor and the driving member, and the motor is connected with the driving member by the gear assembly in a transmission manner; wherein the driving mechanism further comprises a driving housing, and both the driving member and the motor assembly are disposed in the driving housing; wherein the electronic lock comprises the driving mechanism and a power supply assembly used for supplying electric energy to the driving mechanism and controlling the driving mechanism to work, the power supply assembly is electrically connected with the motor, and the power supply assembly, the motor and the driving member are sequentially arranged from left to right; wherein the power supply assembly comprises a battery housing, batteries, characterized in that the power supply assembly further comprises a PCB, wherein the batteries are connected with the PCB, keys for controlling the motor are disposed on the PCB, and the PCB is connected with the motor; battery grooves for mounting the batteries are formed in the upper side of the battery housing, and a PCB groove for mounting the PCB is formed in the lower side of the battery housing; and the two battery grooves are formed in the upper side of the battery housing, an isolating bulge is formed between the two battery grooves, two PCB fixing bulges are formed on positions, corresponding to the two battery grooves, on the lower side of the battery housing, the PCB groove is formed between the two PCB fixing bulges, and the position of the PCB groove corresponds to the position of the isolating bulge. wherein the driving mechanism further comprises a driving housing, and both the driving member and the motor assembly are disposed in the driving housing; wherein the electronic lock comprises the driving mechanism and a power supply assembly used for supplying electric energy to the driving mechanism and controlling the driving mechanism to work, the power supply assembly is electrically connected with the motor, and the power supply assembly, the motor and the driving member are sequentially arranged from left to right; wherein the power supply assembly comprises a battery housing, batteries, characterized in that the power supply assembly further comprises a PCB, wherein the batteries are connected with the PCB, keys for controlling the motor are disposed on the PCB, and the PCB is connected with the motor; battery grooves for mounting the batteries are formed in the upper side of the battery housing, and a PCB groove for mounting the PCB is formed in the lower side of the battery housing; and the two battery grooves are formed in the upper side of the battery housing, an isolating bulge is formed between the two battery grooves, two PCB fixing bulges are formed on positions, corresponding to the two battery grooves, on the lower side of the battery housing, the PCB groove is formed between the two PCB fixing bulges, and the position of the PCB groove corresponds to the position of the isolating bulge.