Tip: #2000 cannot log on to the MySQL server
Today with this machine installed a phpmyadmin, version 3.4.8, want to use it to connect an intranet server on the MySQL, so modify the phpMyAdmin configuration file config.inc.php, add the following code:
$i + +;
$cfg [' Servers '] [$i] [' auth_type '] = ' cookie ';
$cfg [' Servers '] [$i] [' host '] = ' 192.168.8.14 ';
$cfg [' Servers '] [$i] [' user '] = ' kkapp ';
$cfg [' Servers '] [$i] [' connect_type '] = ' TCP ';
$cfg [' Servers '] [$i] [' compress '] = false;
$cfg [' Servers '] [$i] [' allownopassword '] = false;
Save Open Browser login, prompt: #2000 Unable to log on to MySQL server
Check IP, username, password no problem found
With native MySQL client connection can log in normally, indicating network access, database access permissions are no problem
SSH login to the server open the MySQL configuration file to find a line of code:
Old_passwords=1
Note, save, restart MySQL service, or not even
Ask Google, finally found the problem, originally from the "PHP 5.3.3, no longer support the use of old password to connect to the database, you can still use the MySQL client command to log in, after logging in using the"
This machine is loaded with PHP 5.3.10, it will cause the above problems
Workaround:
mysql> update ' MySQL '. ' User ' SET ' Password ' = Password ("******") WHERE ' user ' = ' kkapp ';
mysql> flush Privileges;
Note Old_passwords=1
This line is going to be commented out.
Please set the user name and password according to your database!
phpMyAdmin #2002 Error
Resolve. #2002 cannot log on to the MySQL server
Copy the config.sample.inc.php into config.inc.php
This error indicates that no connection to the database has occurred. Modify the config.inc.php file
Will $cfg[' Servers ' [$i] [' host '] = ' localhost ';
Instead of $cfg[' Servers ' [$i] [' host '] = ' 127.0.0.1 ';
Or
Modify Php.ini:mysql.default_socket =/tmp/mysql.sock Zero Technology
#2003 cannot log on to the MySQL server
Said, I was resolved as follows, for reference only:
The first step
Delete the My.ini below the c:windowns (you can change it to another name first.)
Step Two
Open the corresponding installation directory Mysqlbinwinmysqladmin.exe Enter the user name and password (you can also ignore this step)
The third step under DOS, go to the MySQL bin directory.
Example: installation directory for D-disk Pc_webservermysqlbin
Start-run-cmd >_ BH,/d '
D://Switch to the D-disk first
D:>CD Pc_webservermysqlbin//through the CD directory into the bin
Then enter Mysqld-nt-remove to delete the service
then enter Mysqld-nt-install
Fourth step and restart the MySQL service
#1045 cannot log on to the MySQL server
The following error condition may occur: phpMyAdmin: #1045 cannot log on to the MySQL server. Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Cause: This may be due to the previous setting of the MySQL password is not successful, so we use the set MySQL root password can not log on to the server.
Workaround: You can then attempt to log into the database using the empty password of the MySQL default root account .
If you log in with a blank password, it appears: empty password login is forbidden ( see allow null password) error. To modify the/phpmyadmin/libraries/config.default.php file, locate the following two lines
$cfg [' Servers '] [$i] [' nopassword '] = false;
$cfg [' Servers '] [$i] [' allownopassword '] = false;
Change two false to True and set $cfg [' Servers '] [$i] [' password '] = '; After setting up the configuration file, phpMyAdmin will allow a blank password to log into the MySQL database.
If you re-login to phpmyadmin with a blank password, you may still not be able to log in, please clear the cookie or close the original phpMyAdmin login window and re-login with a blank password.
If this time still shows the blank password login is forbidden, try to enter a few characters as a password to see if the landing is successful.
Log in to MySQL server and change the MySQL password in phpMyAdmin as soon as possible. or modify the MySQL password on the SSH client : Cd/usr/local/mysql/bin
Then execute the command:./mysqladmin-u root-p password.
Finally, all users except root are removed from the MySQL user table.
MySQL cannot log on to server workaround