#2002 Cannot log in to the MySQL server
Posted by: Sjaak (111.43.191.---)
Date: February 02, 2014 07:35AM

I can acces PhpMyAdmin only when I am connected to the internet. When i disconnect my internet connection i get this error message: #2002 Cannot log in to the MySQL server.

So when I am online I can login with root and no password--> offline i get the #2002

Cleared browser history
I installed Microsoft Visual c++ 2005/2008/2010/2012 and Visual J# 2.0
I Checked for ini files out of the wamp folder
Turned off Avira with instalation and when running WAMPSERVER
Dont have windowsfirewall running
Deleted and installed 2.4 and 2.1 numerous times with deleting directory.

I just tried installing it in a VMworkstation and it worked but I dont want to use VMware -_-

Version of Operating system?
Windows XP SP3

Version of Wamp Server installed?
2.4

ersion of Apache you are running?
2.4.4

Version of MySQL you are running?
5.6.12

Version of PHP you are running?
5.4.16

What colour is your WampManager icon? ( the in the system tray )
Green

Do you have a HOSTS file? [c:\windows\system32\drivers\etc\hosts]
127.0.0.1 localhost

MySql log after restarting service

2014-02-02 14:26:55 5272 [Note] Plugin 'FEDERATED' is disabled.
2014-02-02 14:26:55 5272 [Note] InnoDB: The InnoDB memory heap is disabled
2014-02-02 14:26:55 5272 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-02-02 14:26:55 5272 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-02-02 14:26:55 5272 [Note] InnoDB: Not using CPU crc32 instructions
2014-02-02 14:26:55 5272 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-02-02 14:26:55 5272 [Note] InnoDB: Completed initialization of buffer pool
2014-02-02 14:26:55 5272 [Note] InnoDB: Highest supported file format is Barracuda.
2014-02-02 14:26:56 5272 [Note] InnoDB: 128 rollback segment(s) are active.
2014-02-02 14:26:56 5272 [Note] InnoDB: Waiting for purge to start
2014-02-02 14:26:56 5272 [Note] InnoDB: 5.6.12 started; log sequence number 1626017
2014-02-02 14:26:56 5272 [Note] Server hostname (bind-address): '*'; port: 3306
2014-02-02 14:26:56 5272 [Note] IPv6 is available.
2014-02-02 14:26:56 5272 [Note] - '::' resolves to '::';
2014-02-02 14:26:56 5272 [Note] Server socket created on IP: '::'.
2014-02-02 14:26:56 5272 [Warning] Failed to reset IPV6_V6ONLY flag (error: 10042). The server will listen to IPv6 addresses only.
2014-02-02 14:27:01 5272 [Note] Event Scheduler: Loaded 0 events
2014-02-02 14:27:01 5272 [Note] wampmysqld: ready for connections.
Version: '5.6.12-log' socket: '' port: 3306 MySQL Community Server (GPL)

My.ini

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[wampmysqld]
port = 3306
socket = /tmp/mysql.sock
key_buffer = 16M
max_allowed_packet = 1M

sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
basedir=c:/wamp1/bin/mysql/mysql5.6.12
log-error=c:/wamp1/logs/mysql.log
datadir=c:/wamp1/bin/mysql/mysql5.6.12/data

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Disable Federated by default
skip-federated

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = C:\mysql\data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:\mysql\data/
#innodb_log_arch_dir = C:\mysql\data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

[mysqld]
port=3306



Config.inc.php phpmyadmin
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at [docs.phpmyadmin.net].
*
* @package PhpMyAdmin
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/*
* phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
* End of servers configuration
*/




Any idea on the problem?



Edited 3 time(s). Last edit at 02/02/2014 07:45AM by Sjaak.

Options: ReplyQuote
Re: #2002 Cannot log in to the MySQL server
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: February 04, 2014 12:01PM

What are you doing to disconnect from the internet???



This is a bit of a guess, but it sound like when your not connected to the internet a part of the network stack does not get started, or stops when the connection is broken.

As PHP ( phpMyAdmin is written in PHP ) communincates with MySQL via the TCP (part of the network stack) I am assuming that part of the network stack is not there when the router is not connected to the internet and therefore trying to use it wont work!!!


You could consider changing mysql to use shared memory or named-pipes instead of TCP/IP but this is a little complicated and also requires changes to your PHP connection string. This will almost definitely not be the connection mechanism when you transfer your site to a hosted server and will therefore cause you more problems later on when you have completely forgotten that you made this change.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.2.5 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: #2002 Cannot log in to the MySQL server
Posted by: Sjaak (111.43.190.---)
Date: February 05, 2014 04:53AM

Im in China and i got 250 hours of wireless internet every month (with 40GB sad smiley ). The easiest way to turn off this connection is to turn off the wireless adapter ^_^ .


Aah, I already read about changing to named-pipes but since I have no knowledge about anything of these things and I am able to connect to PhpMyAdmin while in VMware i just use that then.



Thanks for the help.

Options: ReplyQuote


Sorry, only registered users may post in this forum.