Home >Database >Mysql Tutorial >A common pitfall in Mysql development - Unable to start Mysql

A common pitfall in Mysql development - Unable to start Mysql

php是最好的语言
php是最好的语言Original
2018-07-25 16:03:311526browse

I was in a hurry yesterday and accidentally deleted the Mysql built-in database. As a result, I used Navicat to open it the next day. Various errors were reported, but it took me 2 hours to solve various bugs. I will record the following here so that I can accidentally make the same mistake again in the future.

Solution for unable to start Mysql

Due to various errors reported, today I ruthlessly deleted all MySql and Navicat, and reinstalled them. After the installation was completed , if you want to enter mysql under CMD to be effective, you need to configure the MySql environment variable under the system. My system is Win10. The configuration is as shown below
(1) Right click on the computer--Properties--Advanced system settings--Environment variables--Path
A common pitfall in Mysql development - Unable to start Mysql (2) Environment variables--System variables Path--New environment variable --This section fills in the bin path under the Mysql installation path
A common pitfall in Mysql development - Unable to start Mysql After configuration, use CMD to net start mysqlStart MySql or computer management-service-- After defining MySql startup, I had no choice but to start reporting the first error
A common pitfall in Mysql development - Unable to start Mysql

I searched for various solutions on the Internet and got a useful method. I found it in the MySql installation directorymy.ini file, modify default-storage-engine=INNODB to default-storage-engine=MYISAM , restart to open MySql

System error 5 occurred

Enter net start mysql under CMD and prompt system error 5. This problem is caused by not logging in as an administrator. Yes, right-click CMD to run as administrator (right-clicking on the program has no effect, you can navigate to C:\windows\System32\CMD and then right-click to run as administrator) Run

access denied for user 'root'@'localhost' (using password yes)

I thought MySql was started and Navicat could be used to connect to the database, but another error was reported. This error was solved It is relatively complicated, the steps are as follows:
(1) Stop the MySql service
cmd:net stop mysql
(2) Open my. ini Find [mysqld] and then add
skip_grant_tables--meaning to start MySQL Skip permission table authentication when serving
(3) Start Mysql, enter mysql under cmd to see the welcome message in English, and then enter the following use mysql connection permissions Database
(4)Change password
update user set password=password("123456") where user="root";
(5)Refresh permissions flush privileges
(6) Finally exit quit
(7) Add the in step 2 skip_grant_tablesRemove it and restart MySql, it will be successful
A common pitfall in Mysql development - Unable to start Mysql

Related recommendations:

MySQL service is starting.MySQL service cannot start up. System error

Under WIN7, mysql was successfully installed. How to manually enable it after banning automatic opening?

Old boy mysql video tutorial:MySQL database multiple instances Startup problem troubleshooting methods and practical troubleshooting

The above is the detailed content of A common pitfall in Mysql development - Unable to start Mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn