MySQL cannot be started and cannot be stopped (it is easy to appear after security settings)

Source: Internet
Author: User

Recently, MySQL on Windows 2003 experienced a failure in connecting to the database when it was running normally many times. This problem occurs when it was unable to connect to the database or stop or restart MySQL. Restarting the database also did not work, since every time we try various methods, we have never studied them in depth. Next time, we will summarize the diagram and fault phenomena. This article first lists common solutions.

1. Confirm that MYSQL is configured and correct
Reconfiguration
If you re-install MYSQL, make sure that the installed MYSQL has been configured for the first time. Otherwise, my. INI file, configuration method, you can select at the last step of installation, now configure MYSQL, or run the MYSQL Configuration Wizard in the program group. After configuration, make sure that the [mysqld] field in the my. ini file contains at least the basedir installation directory and datadir database path.

Before configuration, if you have already configured MySQL, You can first execute remove instance in the MYSQL wizard and then reconfigure it.

Overwrite data table

The default MYSQL database is installed under My Document. Therefore, if your database directory is in another path, you can stop MYSQL and then cut the database to another path, copy the data table to the same directory.

If the MYSQL Data Table uses different accounts, you also need to create an account in MYSQL, or directly use the original MYSQL Data Table to overwrite (you need to confirm that the previous MSYQL data table is not damaged ).

Unable to start

When MYSQL cannot be started, see solution:

A. Run the command C: \ Program files \ mysql \ bin \ mysqladmin-u root-p shutdown to disable MYSQL.

B. Execute net start mysql to start mysql under the cmd command line.

Ii. Common Solution to 1067 errors
Fault symptom

If the 1067 error occurs when you stop MYSQL (net stop mysql) or start MYSQL, the error message "MySql service is stopping... system error (A system error has occurred .)... system error 1067 (System error 1067 has occurred .), the process terminated unexpectedly .).

Common solutions

If you have been running OK all the time before, please first follow the above "cannot start" solution to execute a look.
If you have performed the Remove Instance operation, make sure to check my. whether the datadir In the INI file has been restored. If the database does not exist under this address, the system reports error 1067. You only need to change it to the actual database directory address and start it manually.
Check MYSQL Directory Permissions
Check my. whether the basedir installation directory path and datadir database path exist in the [mysqld] field of the INI file, my. ini may need to appear in two places. Check both the MYSQL installation directory and the Windows directory (assuming the windows environment.
Sometimes Delete % windir %/my. the INI file can be re-configured. After re-configuration, check whether my is in the Windir directory. INI file, sometimes the latest my. if you copy the ini file and overwrite it, the problem can be solved.
For a Linux environment, try mysql. server copy to/etc/rc. d/init. d/, and then run chkconfig mysql. then you can set the PATH in the command line and run the command to start mysql.

Iii. MYSQL cannot be started due to illegal Shutdown
If the MYSQL cannot be started because of an illegal shutdown or other reasons, it is recommended to use the mysql data table that is re-installed or confirmed to be OK and ibdata1, mysql. files such as pid and ib_logfile0 are overwritten. tianyuan has tried many times. This is because the original MYSQL table is faulty and cannot be started, but it can be replaced with a new table.

4. reinstall MYSQL
When a problem occurs in MYSQL, the most convenient method is to uninstall mysql and re-configure it. The specific method is as follows:
1. uninstall MYSQL and clear the my. ini files in the installation directory and Windows directory.
2. Check whether the job manager has a mysqlpath. If yes, you can kill mysqld.exe or kill it before uninstalling it.
3. In the cmd command window, run SC delete mysql, which is a command to clean up and register the service.
3. reinstall mysql

If this problem occurs after the security settings, it may be because mysql runs with low permissions due to password policies and other issues. You may find that the mysql startup user has a password reset, then, set it in the service item.
For example

Note: first change the password in windows Manager.

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.