[2002] An attempt was made to access a socket in a way forbi

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[2002] An attempt was made to access a socket in a way forbi

Postby leatherback » 17. June 2011 21:34

Dear all,

After a few searches, I am still trying to get my server back to life. Windows has uninvitedly decided to restart my machine. All the things I was working on gone, and my server has some trouble.

- commandline acces to mysql shows that mysql is running and still has all my databases
- php admin is unavailable:
* #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

- When trying to run a script, I get an error on the mysql_connect:
* Warning: mysql_connect() [function.mysql-connect]: [2002] An attempt was made to access a socket in a way forbidden by its (trying to connect via tcp://localhost:3306) in [..cut..]

What could this be? It was a fully working installation, which I have been using for weeks without issues. Xampp 1.7.4, control panel 2.5

Hope this sounds familiar to you..

Thanks,

Jelle
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 06:48

There is just a chance that you have more my.ini files other than the one in the \xampp\mysql\bin folder - do a search of your PC and if you find any that are not in the folder mentioned then either rename them or delete them and then try again after restarting MySQL.

Best wishes.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 08:27

Hi Sharley,

Thanks for that. Unfortunately.. Still no difference. However, when I look in the my.ini file, there is a reference to some files:

port = 3306
socket = "C:/xampp/mysql/mysql.sock"

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port= 3306
socket= "C:/xampp/mysql/mysql.sock"

The mysql.sock does not exist. What is this file supposed to contain / do?
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 08:49

Hello Jelle,

This issue with missing mysql.sock came to light just after 1.7.4 was released and a possible fix for this can be found in this post:
viewtopic.php?p=176527#p176527

As mentioned, change both instances to "MySQL" then restart MySQL server.

Basically it's a Linux thing and should be set properly by the Windows developers but has been overlooked in this version.

Fingers crossed. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 09:25

Hi, thanks again; However, *sigh* No fix.

I am not convinced it is in the .ini files though; The whole thing worked fine, untill windows last night decided to do something while I was away: I cam back to my machine and it had rebooted and I could not acces anything. If I check the mysql_error.log for the startup, this is what I get:

# first start of the server after the windows action:
110416 10:17:47 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
110416 10:17:47 InnoDB: Initializing buffer pool, size = 16.0M
110416 10:17:47 InnoDB: Completed initialization of buffer pool
110416 10:17:48 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110416 10:17:48 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
110416 10:17:49 InnoDB: 1.1.4 started; log sequence number 1595675
110416 10:17:51 [Note] Event Scheduler: Loaded 0 events
110416 10:17:51 [Note] mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.8' socket: '' port: 3306 MySQL Community Server (GPL)

# startup after testing ini file edits:
Version: '5.5.8' socket: '' port: 3306 MySQL Community Server (GPL)
110618 10:13:15 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
110618 10:13:15 InnoDB: Initializing buffer pool, size = 16.0M
110618 10:13:15 InnoDB: Completed initialization of buffer pool
110618 10:13:15 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110618 10:13:15 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
110618 10:13:16 InnoDB: 1.1.4 started; log sequence number 3489238
110618 10:13:16 [Note] Event Scheduler: Loaded 0 events
110618 10:13:16 [Note] mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.8' socket: '' port: 3306 MySQL Community Server (GPL)

It seems to still be having dificulties with the database, even though on command line all databases are there. ANy other ideas which might help me get this to live again?
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 09:42

leatherback wrote:It seems to still be having dificulties with the database, even though on command line all databases are there.
From your error log what gives you this assumption?

Here is my error log after starting MySQL
Code: Select all
Version: '5.5.8'  socket: ''  port: 3306  MySQL Community Server (GPL)
110618 18:31:32 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
110618 18:31:32  InnoDB: Initializing buffer pool, size = 16.0M
110618 18:31:32  InnoDB: Completed initialization of buffer pool
110618 18:31:32  InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110618 18:31:32  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
110618 18:31:32  InnoDB: 1.1.4 started; log sequence number 1595675
110618 18:31:32 [Note] Event Scheduler: Loaded 0 events
110618 18:31:32 [Note] g:\xampp174\mysql\bin\mysqld.exe: ready for connections.
Version: '5.5.8'  socket: ''  port: 3306  MySQL Community Server (GPL)
Not checked every word but they look very similar indeed and I have no db issues.

In your XAMPP Control Panel if there is a tick in the Svc box then remove it then after answering the question positively try and Start MySQL again.

If MySQL is already started after your sudden restart by the OS using the Windows Service then this may be the issue and it is not being seen as started by phpMyAdmin so first uninstall the MySQL Windows service either by the above Svc tick method or run the uninstall service bat file in the mysql folder. You can check it has gone by clicking on the SCM button in the control panel and look for the mysql service.

Now manually restart MySQL.

Lets see if that helps.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 09:55

:(

I thought there were database issues, because the log mentioned that the database was not shut down properly and was running a crash recovery. In your log it sais the same however.

There are no MYSQL services up and running according to SMC, and no ticks in the svc boxes.

Pulling hairs here now :D
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 10:25

OK, you could try this little trick I often use especially when I have more than one instance of XAMPP on my PC - no need to uninstall your original version using this little trick.

Using the Control Panel, stop all the components, remove any ticks in all of the Svc boxes, if there are any and then Exit the Control Panel.
Rename your C:\xampp folder to C:\xampp_old

Now download the 1.7.4 Zip version and extract the xampp folder to your C:\ drive so once again you have C:\xampp - don't overwrite the xampp_old folder.

Run the setup_xampp.bat file to set your paths.

Download the new Control Panel from here:
http://arloh.de/xampp/xampp_control3.0.2.zip
Extract the version 3 exe file to the C:\xampp folder and use it instead of the one contained in the release.

Now go to http://localhost and after selecting your language see if all the demos work without issue - don't set your root password for MySQL and phpMyAdmin at this point.

Go to http://localhost/phpmyadmin and make sure all is working as expected without using a password - close phpMyAdmin.

Next you can copy from C:\xampp_old your web site files.
Then go to the C:\xampp_old\mysql\data folder and copy and overwrite the contents to your C:\xampp equivalent folder which should now contain your databases and the system databases from your C:\xampp installation - nothing is lost.
(you do remember your root password though?)

Restart MySQL and then try and access phpMyAdmin using the root user/pass combo.

If problems at this stage then set your root password again from http://localhost/security/

Doing it this way you don't loose anything when reinstalling a wobbly corrupted XAMPP installation.

Good luck with this Jelle. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 11:02

:((
As I feared.. Not a Xampp issue: After doing all this, when I run the localhost and try to access phpadmin... Exactly the same error. Feels like windows has adjusted some settings that is refusing me a connection or something?

Error

MySQL said: Documentation
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
Connection for controluser as defined in your configuration failed.
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 11:16

All is not lost just yet.

Please paste here in between forum code tags your C:\xampp\phpmyadmin\config_inc.php file - thanks.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 11:24

Code: Select all
<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

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

/*
 * First server
 */
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$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]['designer_coords'] = 'pma_designer_coords';

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/*
 * End of servers configuration
 */

?>
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 11:27

Change this line
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'config';
To this
Code: Select all
$cfg['Servers'][$i]['auth_type'] = 'cookie';
Save the file and restart Apache and MySQL, make sure localhost can accept cookies and then try http://localhost/phpmyadmin again.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 11:31

Hi, thanks for your continued help. Unfortunately, this does not imrpove the sidtuation; I actually also tried this before replacing the xampp install. I have done so now as well, and phpadmin now asks for a username / pass. After entering the info this results in:

#2002 Cannot log in to the MySQL server

Connection for controluser as defined in your configuration failed.
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Re: [2002] An attempt was made to access a socket in a way f

Postby Sharley » 18. June 2011 11:34

Try entering your password in this line
Code: Select all
$cfg['Servers'][$i]['password'] = '';
as usual, save and restart but clear your cookies first just in case.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: [2002] An attempt was made to access a socket in a way f

Postby leatherback » 18. June 2011 11:38

I was running mysql without a password; also: The new XAMPP has not has a pass set..
leatherback
 
Posts: 11
Joined: 17. June 2011 21:26

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 137 guests