Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

After restarting the server, there is a MySQL & # 039 localhostkeeper error 039; (10061) what to do?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you what to do when there is a MySQL 'localhost' (10061) error after restarting the server. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. Let's learn about it together.

After restarting the server, there was a MySQL 'localhost' (10061) error. At first, I thought it was because there were too many database links open and the database resources were exhausted, but after restarting the server, there was still a problem, so I looked for a solution on the Internet. It is roughly as follows:

Solution:

The first step

Delete the my.ini under c:\ windows\

Step two

Open c:\ mysql\ bin\ winmysqladmin.exe to enter the user name and password

Step 3 enter mysqld-nt-remove to delete the service under dos

Type mysqld-nt-install next

The fourth step is to enter mysql to start successfully.

Other methods for reference:

1. See if localhost points to 127.0.0.1 in the hosts file.

two。 If the mysql service is not started, you can run net start mysql.

3. Some related commands:

Mysqld-nt-- install # launch Mysql

Mysql # run Mysql

Mysql-h ipAddress-u username-p

Or: go directly to bin and click mysqld.exe or mysqld-nt.exe to see if its process is working properly. If not, go to the control panel and service to start it and see what the error is. If not, delete mysql from add and delete, and then reinstall mysql, which can generally solve the problem. You can back up DATA before installation.

Error: Can't connect to MySQL server on 'localhost' (10061)

Errno.: 2003

Error number: 2003

Problem analysis:

Unable to connect to the MySQL server, possibly:

1. The MySQL service is not started, which is usually caused by the failure of MySQL to start under abnormal circumstances, such as no available disk space, incorrect basedir path setting of MySQL in my.ini, etc.

2. The MySQL server cannot connect because of the shortage of resources.

Solution:

1. If you are a virtual host user (purchased space), contact the space provider to check whether MySQL starts normally, and confirm the configuration information of MySQL (whether it is localhost).

2. If you are a standalone host user (with permission to manage hosts), follow these steps to check:

1) check whether there is any free disk space, and try to keep enough disk space available.

2) check whether the parameters such as basedir (MySQL installation address) and datadir (data directory storage address) in my.ini are set correctly, and then restart the MySQL service.

Another way is to patch the server's windows.

Microsoft released the TCP/IP update patch (KB967723) on Sept. 9, which can occur if the server turns on automatic updates or if an automatic update software downloads the patch.

Some people may ask, why did the patch on the 9th not find the problem until now?

As we all know, the server does not restart every day, some servers may restart once a month or a year or half a year, and some may restart the server after September 9, so the patch took effect (I personally think so).

Patch uninstall method: log in to the server and go to the control panel-add and remove programs (check "Show updates" above)

You can see the updated KB967723 patch inside, and then uninstall it just like uninstalling ordinary software. during the uninstall, you will be prompted that if the uninstall may cause an error in the running of the program, it does not matter, select "Yes" and continue to uninstall.

After uninstalling the program server, everything is normal!

As for what vulnerabilities the patch fixes and whether there will be server security risks after uninstalling, this is the only temporary solution to the normal operation of MYSQL.

In another case, you can solve it this way.

Discuz! Info: Can not connect to MySQL server

Time: 2007-11-13 6:25pm

Script: / bbs/index.php

Error: Can't connect to MySQL server on 'localhost' (10061)

Errno.: 2003

Similar error report has beed dispatched to administrator before.

Normally, the reasons are as follows:

The number of visits to the website forum is too large and the database connection exceeds the maximum number of connections. MySQL database service stopped.

Solution (for WIN systems):

1. First, find the MYSQL service in the system service and start the MYSQL service.

2, go to the MYSQL installation directory to find the MY.INI file, open MY.INI to find max_connections, modify the number of connections to 1000 and restart IIS and MYSQL services.

Under window

Enter under the command line:

> cd E:\ mysql\ bin

> mysqladmin-u root password your password

> mysql-u root-p

Enter password: your password

You can.

Having found the root cause, let's cool it down here:

The root cause of this problem is that because the password is set for the root of mysql, rather than that the password was empty when it was originally installed, use the

Mysqladmin version doesn't work like this. It has to be like this: mysqladmin-uroot-p version. Enter according to the prompt after you enter.

The command can be run successfully with the root password.

The first method is actually a solution without knowing the root password, so that you can enter mysql without a password.

And change the root password to solve the problem of forgetting the root password.

Enter the command "mysqladmin-u root password your password" to change the password of the root user.

Prompt for the original password and executed successfully, which also indicates that the original password is empty. After that, you can log in successfully using the modified password.

. . How to change the password?

First of all, let's make it clear that in most cases, modifying MySQL requires the permission of root in mysql, so ordinary users cannot change their passwords.

Unless an administrator is requested

Method one

Using phpmyadmin, which is the easiest, modify the user table of the mysql library

But don't forget to use the PASSWORD function.

Method two

Using mysqladmin, this is a special case of the previous declaration.

Mysqladmin-u root-p password mypasswd

After entering this command, you need to enter the original password of root, and then the password of root will be changed to mypasswd.

Change the root in the command to your user name, and you can change your own password.

Of course, if your mysqladmin can't connect to mysql server, or if you can't execute mysqladmin,

Then this method is ineffective.

And mysqladmin can't clear the password.

The following methods are used at the mysql prompt and must have root permission for mysql:

Method three

Mysql > INSERT INTO mysql.user (Host,User,Password)

VALUES ('%', 'jeffrey',PASSWORD (' biscuit'))

Mysql > FLUSH PRIVILEGES

To be exact, this is adding a user with the user name jeffrey and the password biscuit.

There is this example in the mysql Chinese reference Manual, so I wrote it out.

Note that you use the PASSWORD function, and then you use FLUSH PRIVILEGES.

Method 4

Same as method 3, except that the REPLACE statement is used

Mysql > REPLACE INTO mysql.user (Host,User,Password)

VALUES ('%', 'jeffrey',PASSWORD (' biscuit'))

Mysql > FLUSH PRIVILEGES

Method five

Use the SET PASSWORD statement

Mysql > SET PASSWORD FOR "= PASSWORD ('biscuit')

The PASSWORD () function must also be used.

But you don't need to use FLUSH PRIVILEGES.

Method 6

Use GRANT... IDENTIFIED BY statement

Mysql > GRANT USAGE ON *. * TO "IDENTIFIED BY 'biscuit'

The PASSWORD () function is unnecessary here, and you don't need to use FLUSH PRIVILEGES.

Note: PASSWORD () [not] performs password encryption in the same way that Unix passwords are encrypted.

The solution of MySQL forgetting password

If MySQL is running, kill it first: killall-TERM mysqld.

Start MySQL: bin/safe_mysqld-- skip-grant-tables &

You can enter MySQL without a password.

And then there is.

> use mysql

> update user set password=password ("new_pass") where user= "root"

> flush privileges

Kill MySQL again and start MySQL in the normal way.

Under linux

Method 1:

# / etc/init.d/mysql stop

# mysqld_safe-user=mysql-skip-grant-tables-skip-networking &

# mysql-u root mysql

Mysql > UPDATE user SET Password=PASSWORD ('newpassword') where USER='root'

Mysql > FLUSH PRIVILEGES

Mysql > quit

# / etc/init.d/mysql restart

# mysql-uroot-p

Enter password:

Mysql >

Method 2:

Directly use the username and password provided in the [client] section of the / etc/mysql/debian.cnf file:

# mysql-udebian-sys-maint-p

Enter password:

Mysql > UPDATE user SET Password=PASSWORD ('newpassword') where USER='root'

Mysql > FLUSH PRIVILEGES

Mysql > quit

# mysql-uroot-p

Enter password:

Mysql >

Method 3:

# mysql-uroot-p

Enter password:

The above is all the contents of this article, "what to do if there is a MySQL 'localhost' (10061) error after restarting the server?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report