[Solution] the last step of MySQL installation in XP prompts the service cocould not be started. Error: 0 Error

Source: Internet
Author: User

1. The last step of MySQL installation in XP prompts the service cocould not be started. Error: 0 error.
Solution:

Start-run, enter "services. msc" to check whether MySQL service exists
If yes and cannot be started manually
Open the registry and go to "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services"
Delete the service corresponding to MySQL

Control Panel-add and deleteProgram-Delete MySQL.

Delete C: // programe files/MySQL
Delete c: \ Documents ents and Settings \ All Users \ Application Data \ mysql

MySQL Default port: 3306

 

2. When installing MySQL, the system prompts "cannot create Windows Service for MySQL. Error: 0 ".

The reason is that the old MySQL service exists in the system. The solution is as follows:

To permanently delete the old MySQL service, you must run the following command on the command line with the administrative permission:
C: \> SC Delete MySQL
[SC] deleteservice success

SC command Introduction

View code

*! Cteate a table test; */
Drop table if exists 'baninfo _ special ';
Create Table 'baninfo _ special '(
'Id' Int ( 11 ) Not null auto_increment,
'Special _ id' Int ( 11 ) Not null,
'Port' Int ( 11 ),
'Time' timestamp,
'Src _ ip' varchar ( 64 ) Default   '' ,
'Ac' Int ( 11 ),
'Baninfo _ specialname' varchar ( 64 ) Default   '' ,
'Password' varchar ( 64 ) Default   '' ,
Primary Key ('id ')
) Engine = MyISAM default charset = ' Utf8 ' ;

Appendix, service operations:
To delete a system service, use SC Delete
[Service name]. For example, to delete the Messager service, enter SC Delete Messager.
SC uses the following syntax:
1 . SC [servername] command servicename [optionname = Optionvalue]
2 . SC [command]
The first syntax uses SC and the second syntax displays help.
The following describes the parameters.
Servername
Optional: You can use double slashes, such as \ myserver or \\ 192.168 . 0 . 1 to operate the remote computer. If you operate on a local computer
You do not need to add any parameters.
Command
The following lists the SC commands that can be used.
Config ---- Change the configuration of a service. (Long term)
Continue -- Sends a request for continuous control over a service.
Control ---- Sends a control to a service.
Create ---- Create a service. (Add to Registry)
Delete ---- Delete a service. (Delete from Registry)
Enumdepend -- Lists the service dependencies.
Getdisplayname -- Obtain the display name of a service.
Getkeyname -- Obtain the service key name of a service.
Interrogate -- Sends a query control request to a service.
Pause ---- Sends a suspend control request to a service.
QC ---- Ask about the configuration of a service.
Query ---- To query the status of a service, you can also list the status types of the service.
Start ---- Start a service.
Stop ---- Sends a stop request to a service.
Servicename
Name specified for the service key in the registry. Note that this name is different from the display name (this name can be set using net start and service control.
And SC uses the service key name to identify the service.
Optionname
The optionname and optionvalue parameters allow you to specify the name and value of the operation command parameters. Note that this is important in terms of the operation name and
There is no space between them. I don't know the result at first .................., For example, start = Optionvalue, which is very important.
Optionvalue can be 0, 1 Or more operation parameter names and value pairs.
If you want to view the optionvalue available for each command, you can use the SC command format. This will provide you with detailed help.
Optionvalue
Specify a value for the parameter name of optionname. The range of valid values is usually limited to the optionname parameter. Use
SC command to query each command.
Comments
Many Commands require administrator permissions, so I would like to say that you should be the administrator when operating these commands. Haha!
When you click "SC .exe" without any commands, SC .exe displays help information and available commands. When you type SC followed by the command name, you can
To a detailed list of commands. For example, you can enter SC create to obtain a list related to create.
Except for one command, SC query exports the status of all services and drivers currently running in the system.
When you use the start command, you can pass some parameters (arguments) to the main function of the service, but not to the main function of the service process.
SC create
This command can be used to create an entry in the Registry and service control management database.
Syntax 1
SC [servername] Create servicename [optionname = Optionvalue]
The servername, servicename, optionname, and optionvalue here are the same as those above. Here we will detail
Optionname and optionvalue.
Optionname -- Optionvalue
Description
Type = ---- Own, share, interact, kernel, filesys
About the service creation type, the option value includes the type used by the driver. The default value is share.
Start = ---- Boot, system, auto, demand, Disabled
About the Service Startup type, the option value includes the type used by the driver. The default value is demand (Manual ).
Error = ---- Normal, severe, critical, ignore
The default value is normal.
Binpath = -- ( String )
The path name of the Service binary file. There is no default value here. This string must be set.
Group = ---- ( String )
The group to which this service belongs. The list of this group is saved under servicegrouporder in the registry. The default value is nothing.
Tag = ---- ( String )
If this string is set to yes, SC can get a tagid from createservice call. However, SC does not display this label
It makes little sense to use this. The default value is nothing.
Depend = ---- (Space separated String .
The name or group of the service that must be started before the service starts.
OBJ = ---- ( String )
The name used for account running. The default value is LocalSystem.
Displayname = -- ( String )
A string used to identify each service in the user interface program.
Password = -- ( String )
a password, which must be used if an account is different from the LocalSystem account.
optionvalue
Value List of the optionname parameter. Refer to optionname. When we enter a string, if we enter an empty reference, this means that
An empty string will be imported.
comments
the SC create Command performs the operations of the createservice API
function.
the SC CREATE Command executes the createservice API function operation. For details, see createservice.
Example 1
the following example registers a registry created for a service called newservice on a computer named \ myserver.
SC \ myserver create newservice binpath = C: \ winnt \ system32 \ newserv.exe
By default, this service creates a win32_assist_process startup mode using service_demand_start. This will not have any subordination
Will also run according to the LocalSystem security up-down relationship.
Example 2
In the following example, a service is created on a local computer and runs on its own process automatically. It
From the TDI group and NetBIOS service. Note that you must add a space reference to the slave.
SC create newservice binpath = C: \ winnt \ system32 \ newserv.exe type = Own
Start = Auto depend =   " + TDI Netbios "  
Example 3
Service developers can temporarily change the binary path (image path) to run the service in the context of the kernel debugger. Lower
In this example, we can see how to change the service configuration.
SC config newservice binpath =   " Ntsd-d c: \ winnt \ system32 \ newserv.exe "  
In this example, the service controller calls ntsd.exe to use the following parameter string:
" -D c: \ nt \ system32 \ newserv.exe "
ntsd interrupts the debugger when the system is installed with newserv.exe, therefore, the breakpoint can be set in the Code service.
SC qc
the SC QC "ask for configuration" command can list the configuration information of a service and the query_service_config structure.
Syntax 1
SC [servername] QC servicename [buffersize]
parameters
servername and servicename have been described earlier.
buffersize, which can be selected to list the buffer size.
comments
the SC QC command displays the content of the query_service_config structure.
The following is the region of query_service_config.
type ------ Dwservicetype
Start_type ---- Dwstarttype
Error_control ---- Dwerrorcontrol
Binary_path_name -- Lpbinarypathname
Load_order_group -- Lploadordergroup
Tag ------ Dwtagid
Display_name ---- Lpdisplayname
Dependencies ---- Lpdependencies
Service_start_name -- Lpservicestartname
Example 1
The following example shows the configuration of the "newservice" service created in the preceding example:
SC \ myserver QC newservice
SC displays the following information:
SERVICE_NAME: newservice
Type: 20 Win32_cmd_process
Start_type: 3 Demand_start
Error_control: 1 Normal
Binary_path_name: C: \ winnt \ system32 \ newserv.exe
Load_order_group:
Tag: 0  
Display_name: newservice
Dependencies:
Service_start_name: LocalSystem
Newservice can share a process with other services. But it is not automatically started. The binary file name is newserv.exe. This service
It does not rely on other services and runs in the security context of lcoalsystem. These are basic responses to queryservicestatus.
Back, if you need more details, you can look at the API function file.
SC Query
The SC query command can obtain service information.
Syntax:
SC [servername] query {servicename | Optionname = Optionvalue ...}
Parameters:
Servername, servicename, optionname, and optionvalue are not interpreted. Let's just talk about the value provided by this command.
Optionname -- Optionvalue
Description
Type = ---- Driver, service, all
Lists the service types. The default value is service.
State = ---- Active, inactive, all
Lists the status of a Service. The default value is active.
Bufsize = -- (Numeric value)
List the buffer size. The default value is 1024 bytes.
Ri = ---- (Numeric value)
However, when listing, the number of the Restoration pointer is 0 by default.
Optionvalue
Same as above.
Comments
The SC query command displays the service_status structure.
The following figure shows the service_status structure:
Type ------ Dwservicetype
State ------ Dwcurrentstate, dwcontrolsaccepted
Win32_exit_code ---- Dwwin32exitcode
Service_exit_code -- Dwservicespecificexitcode
Checkpoint ---- Dwcheckpoint
Wait_hint ---- Dwwaithint
After the computer is started, use SC
The query command will tell you whether or not it is not an attempt to start the service. If the service is successfully started, the win32_exit_code interval will contain a value of 0. When the attempt fails, it realizes that the service cannot be started, this interval also provides an exit code for the service.
Example
Query "newservice" " Service status, type:
SC query newservice
The following information is displayed:
SERVICE_NAME: newservice
Type: 20 Win32_cmd_process
State: 1 Stopped
(Not_stoppable, not_pausable, ignores_shutdown)
Win32_exit_code: 1077 ( Zero X 435 )
Service_exit_code: 0 ( 0x0 )
Checkpoint: 0x0  
Wait_hint: 0x0  
Note: there is an exit code for this service. Even if this service department is not running, type net helpmsg 1077 , You will get a description of the 1077 error message:
The service has not been started yet.
So here I want to say that we hope you can use net helpmsg, which will be of great help to your learning.
The following describes the SC query command:
To list the status of the active service and driver, run the following command:
SC Query
To display the messenger service, run the following command:
SC query messenger
To list only the active drivers, run the following command:
SC Query type = Driver
To list Win32 services, run the following command:
SC Query type = Service
To list all services and drivers, run the following command:
SC query state = All
Use a buffer of 50 bytes to list data. Use the following command:
SC query bufsize =   50  
Use index to restore the list = 14 , Use the following command:
SC query ri = 14  
To list all interactive services, run the following command:
SC Query type = Service Type = Interact
Run the SC command on the command line.
For details about the SC command, please view the help (SC /? ). Here, we only briefly mention how to add system service functions.
Join Service:
SC create servicename binpath = Path start = Auto
(The space after the equal sign is required)
Delete service:
SC Delete servicename
E. g
Add tomcat to the System Service:
SC create Tomcat binpath = F: \ apache - Tomcat \ bin \ Startup. bat start = Auto
Delete the Tomcat service:
SC Delete Tomcat
SC description Tomcat " Provides end-to-end security between clients and servers on TCP/IP networks. If this service is disabled, clients and servers on the network

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.