Mysql startup prompts that mysql. host does not exist. How can this problem be solved?

Source: Internet
Author: User
After I deleted the original mysql4.0 file in s9, I installed a new mysql5.0 file. During the startup process, I reported an error and failed to start the file. I checked the old post in the group and did not provide a specific description.

After I deleted the original mysql4.0 file in s9, I installed a new mysql5.0 file. During the startup process, I reported an error and failed to start the file. I checked the old post in the group and did not provide a specific description.

Records in the error log:

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql. host' doesn' t exist

I posted a post. I only saw it, but no one replied. I can only solve the problem by myself. Can I help myself... You don't have to mention it. It actually solved the problem. People are all forced out ,.... there is no way. This problem may be a very simple problem for the experts, but for the first time I touched mysql, I did not understand it.
Now, let's talk about the process of solving the problem:

Follow the mysql installation steps:
Shell> groupadd mysql
Shell> useradd-g mysql
Shell> gunzip | mysql-VERSION.tar.gz | tar-xvf-
Shell> cd mysql-VERSION
Shell>./configure -- prefix =/usr/local/mysql
Shell> make
Shell> make install
Shell> scripts/mysql_install_db -- user = mysql
Shell> chown-R root/usr/local/mysql
Shell> chown-R mysql/usr/local/mysql/var
Shell> chgrp-R mysql/usr/local/mysql
Shells> cp support-files/my-medium.cnf/etc/my. cnf
Shell>/usr/local/mysql/bin/mysqld_safe -- user = mysql &

There is no problem with this standard, but when I start mysql in the last step, I want to put the database data file under another directory and change the startup command:
Shell>/usr/local/mysql/bin/mysqld_safe -- user = mysql -- log-error =/u01/mysql/mysql_error/error -- datadir =/u01/mysql/data

This problem occurs because the permission table created by default is under the default directory/usr/local/mysql/var when initializing the database permission table, this leads to the failure to find the permission Table: Can't open and lock privilege tables: Table 'mysql. host 'doesn' t exist

Solution: When you run the initialization permission table, add the parameter datadir. The command format is as follows:
Shell> scripts/mysql_install_db -- user = mysql -- datadir =/u01/mysql/data
This solves the problem.
This problem also occurs when you change the data files of your database to another directory, because you have not created a database permission table in the corresponding directory, the solution is to re-run the mysql_install_db file to regenerate the database permission table, but you also need to re-create the user and Set permissions; the second method should be to copy the files in the old permission table to the corresponding database table directory first, but the second method I did not use is just based on my own imagination. If you have a master, check whether it is correct.

MySQL prompts a solution for Service Startup failure

This problem was often encountered in the past, but it was handled in the following ways,

Uninstall MySQL In the Add/delete program, rename the directory of the original MySQL, and then use F3 to search for "MySQL" and delete all, it can be done by restarting the machine and re-installing MySQL. However, the problems encountered today are more special. I have tried all the methods above and below, but I still cannot, after the installation fails at the last time, all running services and software are turned off and re-installed N times continuously, later, I tried to change to a later version. After deleting all the files and reinstalling them to the last step, I waited for a long time and finally succeeded. Now I have recorded the results, you don't need to be depressed when you encounter such problems in the future!

The reinstallation was successful, but after the restart test, it was found that there was another problem and the service could not be started. The following error was reported:
The MySQL service cannot be started on the local computer.
Error 1053: the service did not respond to the start or control request in time.

The terminal ends. Right-click the MySQL directory and choose "property security". Add the user "MySQLUSER" and grant full control permissions. Then, open the Service Manager and right-click the MySQL service, enter the created account and password to confirm, as shown in!

At last, restart the service at will, and restart the computer and try again. This problem is completely solved. The root cause is the $ character in the system administrator account.

A few common MySQL and MySQL management tools are provided!

Http://sys.7i24.com/soft/mysql5132.rar
Http://sys.7i24.com/soft/mysql5158.rar
Http://mysql.he.net/Downloads/MySQL-5.5/mysql-5.5.21-win32.msi

MySQL 5.5.12 official edition (For Windows 64-bit)
Thunder: // token =

● Navicat for MySQL V9.0.15 green _ Excellent database management and development tools
Thunder: // token =


= ============
When mysql is installed to the last step, the start service is in the failed status. Why?

Use services. msc to open the service window and check whether the MySQL service already exists. If the service already exists and has been started, stop the service first and go to the notice tables ("HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services") to remove the corresponding Services, run the SC delete MySQL command and then install the command.
When MYSQL is installed, cocould not start the service mysql error: 0 is processed.
When you encounter the cocould not start the service mysql error: 0 error during installation and reinstallation, you can try the following two methods.
I. method 1
When installing MySQL, the error "cocould not start the service mysql error: 0" is displayed. solution:
First, stop MySQL services in the management tools> services, and then open cmd to enter your MySQL bin directory, such as C: \ Program Files \ MySQL Server 5.0 \ bin and then use the following command mysqld-nt-remove to display ...... success! Now go to add and delete programs, find MySQL and select Uninstall. Remember to select remove. Finally, delete the MySQL directory and the database directory.
I. method 2
Check whether mysql is in the service. If yes, stop the service;
Install mysql 5.1.33. An error occurs in the third Start Service in the Execute strongattion step when the Server Instance Configuration wizard is running, the error message "cocould not start the service MySQL" is displayed. (This is generally because mysql is installed and cannot be uninstalled. Uninstall and restart before reinstalling. Note that you can use mysqld-nt-remove to uninstall the service if it fails to be uninstalled ).
Run the Add/delete program on the Control Panel to uninstall mysql;
Open it after uninstallation and view the key values under HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services. If there is a mysql key value (mysql, mysqladmin), delete it;
Restart and delete the residual directory of mysql installation (check that mysql is not available in the Service );
Reinstall mysql. After installation, do not run Server Instance Configuration wizard. After restart, run the wizard in the Start Menu.
Mysql-5.0.81 System
Tip: 1045 access denied for user 'root' @ 'localhost' using password yes
Solution to apply security setting error during MySQL 5.1 Installation
Mysql installation error apply security settings Solution
The security settings cocould not be applied to the database because the connection has failed with the following error.
Error Nr. 1045
Access denied for user 'root' @ 'localhost' (using password: YES)
If a personal firewall is running on your machine, please make sure you have opened the TCP port 3306 for connections. otherwise no client application can connect to the server. after you have opened the port please press [Retry] to apply the security settings.
If you are re-installing after you just uninstalled the MySQL server please note that the data directory was not removed automatically. therefore the old password from your last installation is still needed to connect to the server. in this case please select skip now and re-run the Configuration Wizard from the start menu.
Solution to apply security setting error during MySQL 5.1 Installation
1. uninstall MySQL
2. Delete the directory C: \ Documents ents and Settings \ All Users \ Application Data \ MySQL.
3. reinstall MySQL.
------------------------------------------
[MySQL] cocould not start the service MySQL Solution
Install mysql 5.1.33. An error occurs in the third Start Service in the Execute strongattion step when the Server Instance Configuration wizard is running, the error message "cocould not start the service MySQL" is displayed. (This is generally because mysql is installed and cannot be uninstalled. Uninstall and restart before reinstalling. Note that you can use mysqld-nt-remove to uninstall the service if it fails to be uninstalled ).
The specific method is as follows:
Check whether mysql is in the service. If yes, stop the service;
Run the Add/delete program on the Control Panel to uninstall mysql;
Open it after uninstallation and view the key values under HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services. If there is a mysql key value (mysql, mysqladmin), delete it;
Restart and delete the residual directory of mysql installation (check that mysql is not available in the Service );
Reinstall mysql. After installation, do not run Server Instance Configuration wizard. After restart, run the wizard in the Start Menu.
PS: A Reference Method
---------------------------------------------
Msyql installation to the last step start service error Solution
1. In the control panel, delete mysql first.
2. Delete the mysql directory under drive C: \ Program Files.
3. If you still have a directory set on another disk, you must also delete the. Empty directory.
4. regedit
The Code is as follows:
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL

If yes, delete all!
(Tip: Use F3 to search for "mysql" cyclically ")
5. If mysql content in the task manager is also deleted
6. Shut down the firewall.
7. reinstall mysql (I have not restarted the computer here)
Restart the computer, disable IIS, and delete temporary files in temp if necessary.
If this is not the case, change the mysql service name When configuring mysql.
**************************************** **************************************** **********
---------------------------
An error occurred while deleting the item.
---------------------------
Unable to delete LEGACY_MYSQL51: An error occurred while deleting the item.
---------------------------
OK
---------------------------
Solution: Right-click the item to add all the permissions of administrators.
The cannot create windows service for mysql. error: 0 error may occur during mysql installation. Most of the causes of the error are caused by re-installing mysql or upgrading mydql using MySQL Configuration Wizard.
Solution: Go to regedit and use F3 to search for "mysql". Delete All and reinstall mysql.

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.