MAMP mysql not starting - mysql

Got error: 2002: Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2) when trying to connect
150629 15:44:35 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
150629 15:44:35 [Warning] You have forced lower_case_table_names to 0 through a command-line option, even though your file system '/Applications/MAMP/db/mysql/' is case insensitive. This means that you can corrupt a MyISAM table by accessing it with different cases. You should consider changing lower_case_table_names to 1 or 2
150629 15:44:35 [Note] Plugin 'FEDERATED' is disabled.
150629 15:44:35 [Note] Plugin 'ndbcluster' is disabled.
/Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
150629 15:44:35 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
150629 15:44:35 InnoDB: Started; log sequence number 1 402900962
150629 15:44:35 [ERROR] /Applications/MAMP/Library/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
150629 15:44:35 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
150629 15:44:35 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
I can't find mysql.sock file anywhere. This is MAMP 1.9 on OS X version 10.8.5

The first thing to try is to change the ownership of the datadir of MySQL, for example, if you run MySQL with user mysql:
chown -R mysql:mysql /path/to/datadir
check the privilges of /Applications/MAMP/tmp/mysql/ directory for creating socket.

Related

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) . mysql.sock not exist in /var/lib/mysql/

Magento Showing "There Has Been Error Processing Your Request "
When trying to command " sudo service mysqld restart" but failed to Start
Then See the Log Showing me " SQLSTATE[HY000] [2002] No such file or directory "
I do Little search on Google, stackoverflow, magento stackoverflow sites and at last got something may be
after the Command " mysqld -u root -p status"
showing 'mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
I located that I don't have mysql.sock in /var/lib/mysql/ So now what I should do . I am not in expert just newbie . Unfortunately I gave 777 permission to all directory in ec2 instance, after some time of this Issue I see My site " There has been an error processing your request . for ec2 security reason I was not able to access instance using ftp or ssh . so I had to do create new instance gave this EBS to new instance , after changing permission I able to access my instance
Please take a look at my my.cnf file. I am seeing something can help
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Here is The mysqld.log
/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibmCz4dv' (Errcode: 13)
160212 18:29:37 InnoDB: Error: unable to create temporary file; errno: 13
160212 18:29:37 [ERROR] Plugin 'InnoDB' init function returned error.
160212 18:29:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160212 18:29:37 [ERROR] Unknown/unsupported storage engine: InnoDB
160212 18:29:37 [ERROR] Aborting
160212 18:29:37 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160212 18:29:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
775 to /tmp and Now The mysqld.log
775 to /tmp and mysqld.log
/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibLzshr1' (Errcode: 13)
160213 9:08:59 InnoDB: Error: unable to create temporary file; errno: 13
160213 9:08:59 [ERROR] Plugin 'InnoDB' init function returned error.
160213 9:08:59 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160213 9:08:59 [ERROR] Unknown/unsupported storage engine: InnoDB
160213 9:08:59 [ERROR] Aborting
160213 9:08:59 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160213 09:08:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Please help me to Sort it out
The mysql user obviously doesn't have the rights to create a file in /tmp according to
/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibmCz4dv' (Errcode: 13)
check the access rights on /tmp, should be 777. BTW sys "errno 13" is "Permission denied"
According to this, the server stops and doesn't create any socket which then causes the connect error.
I want to say thanks # Axel Amthor . Finally I gave /tmp file 777 and Restarted mysqld .. and Boom
Site back in Action . Sorry i can't give Upvote because i didn't have reputation 15 :(

CentOS Can't get MySQL started when trying to updated from MySQL 5.1 to 5.5

I've waded through forum post after forum post. I can't figure this out. I'm using CentOS 6.5, which had MySQL 5.1, but I need 5.5! I've been looking at a lot of posts but the main one I've been using as my go to manual is this one. I've attached a step by step of what I have done and their results. I
can tell that I have 5.5, but I can't get it to start.
[informatics#aib-bitest ~]$ sudo /sbin/service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]
## Tried to restart [root#aib-bitest log]# service mysqld restart Stopping mysqld: [ OK ] MySQL Daemon failed to start. Starting mysqld: [FAILED]
## Tried to update [root#aib-bitest log]# mysql_upgrade Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck FATAL ERROR: Upgrade failed
## Realized that mysqld is not running [root#aib-bitest log]# service mysqld status mysqld is stopped
## And then Realized that I couldn't get it running. [root#aib-bitest log]# service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]
## Just tested this just because [root#aib-bitest log]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
## Changed access rights [root#aib-bitest log]# chown -R mysql:mysql /var/lib/mysql [root#aib-bitest log]# service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]
## Restarted Apache [root#aib-bitest log]# sudo service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] [root#aib-bitest log]# service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]
[root#aib-bitest log]# mysql_install_db Installing MySQL system tables... 150417 10:06:12 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 150417 10:06:12 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 150417 10:06:12 [ERROR] Aborting
150417 10:06:12 [Note]
Installation of system tables failed! Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
shell> /usr/libexec/mysqld --skip-grant &
and use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables:
shell> /usr/bin/mysql -u root mysql
mysql> show tables
Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /var/lib/mysql that may be helpful.
Please consult the MySQL manual section 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source are the MySQL email archives available at http://lists.mysql.com/.
Please check all of the above before submitting a bug report at http://bugs.mysql.com/
#--------------------------------------------------------------------------------------------
[root#aib-bitest log]# /usr/libexec/mysqld --skip-grant 150417 10:07:30 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 150417 10:07:30 [Warning] Using unique option prefix skip-grant instead of skip-grant-tables is deprecated and will be removed in a future release. Please use the full name instead. 150417 10:07:30 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 150417 10:07:30 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
150417 10:07:30 [ERROR] Aborting
150417 10:07:30 [Note]
#--------------------------------------------------------------------------------------------
[root#aib-bitest log]# /usr/libexec/mysqld --skip-grant-tables 150417 10:08:20 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 150417 10:08:20 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 150417 10:08:20 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
150417 10:08:20 [ERROR] Aborting
150417 10:08:20 [Note]
#--------------------------------------------------------------------------------------------
## Added user = mysql to /etc/my.cnf [root#aib-bitest log]# nano /etc/my.cnf
## Tried this again [root#aib-bitest log]# /usr/libexec/mysqld --skip-grant-tables 150417 10:35:38 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 150417 10:35:38 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 150417 10:35:38 [Note] Plugin 'FEDERATED' is disabled. 150417 10:35:38 InnoDB: The InnoDB memory heap is disabled 150417 10:35:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins 150417 10:35:38 InnoDB: Compressed tables use zlib 1.2.3
150417 10:35:38 InnoDB: Using Linux native AIO 150417 10:35:38 InnoDB: Initializing buffer pool, size = 128.0M 150417 10:35:38 InnoDB: Completed initialization of buffer pool 150417 10:35:38 InnoDB: highest supported file format is Barracuda. 150417 10:35:38 InnoDB: Waiting for the background threads to start 150417 10:35:39 InnoDB: 5.5.40 started; log sequence number 1595675 150417 10:35:39 [ERROR] Aborting
150417 10:35:39 InnoDB: Starting shutdown... 150417 10:35:40 InnoDB: Shutdown completed; log sequence number 1595675 150417 10:35:40 [Note]
#--------------------------------------------------------------------------------------------
[root#aib-bitest log]# /sbin/service mysqld start MySQL Daemon failed to start. Starting mysqld: [FAILED]

Error establishing a database connection

I have a wordpress site on a VPS running Debian 7 that was working fine when I last visited it and I've made no changes since, but now when I visit the site it says: Error establishing a database connection. It also gives the same error in the admin portal.
I had not changed the password, domain, IP, or anything and checked the wp-config.php and everything in it is accurate.
I logged into my VPS as root and tried to log into mysql to check to see if wordpress was still a user, but it couldn't locate the socket:
root#debian7:~# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
So I tried restarting the mysqld and got:
root#debian7:~# /etc/init.d/mysql restart
[ ok ] Stopping MySQL database server: mysqld.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
When I try to run mysqld:
root#debian7:~# mysqld
131226 15:36:15 [Warning] Can't create test file /var/lib/mysql/debian7.lower-test
131226 15:36:15 [Warning] Can't create test file /var/lib/mysql/debian7.lower-test
131226 15:36:15 [Note] Plugin 'FEDERATED' is disabled.
131226 15:36:15 InnoDB: The InnoDB memory heap is disabled
131226 15:36:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131226 15:36:15 InnoDB: Compressed tables use zlib 1.2.7
131226 15:36:15 InnoDB: Using Linux native AIO
mysqld: Can't create/write to file '/tmp/ibRx51To' (Errcode: 30)
131226 15:36:15 InnoDB: Error: unable to create temporary file; errno: 30
131226 15:36:15 [ERROR] Plugin 'InnoDB' init function returned error.
131226 15:36:15 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
131226 15:36:15 [ERROR] Unknown/unsupported storage engine: InnoDB
131226 15:36:15 [ERROR] Aborting
131226 15:36:15 [Note] mysqld: Shutdown complete
So it seemed to be an access problem, so I checked the /var/lib/mysql directory
root#debian7:~# stat /var/lib/mysql
File: `/var/lib/mysql'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 391599 Links: 6
Access: (0700/drwx------) Uid: ( 104/ mysql) Gid: ( 106/ mysql)
Access: 2013-12-10 15:58:56.401341180 -0500
Modify: 2013-12-10 15:58:56.241341172 -0500
Change: 2013-12-10 15:58:56.241341172 -0500
Birth: -
As you can see, mysql is the owner and has rwx access..
The logs are somehow empty so I can't figure out what happened. I'm not familiar with troubleshooting these kinds of things though. So I could be making novice mistakes.
I'm just trying to get my wordpress site back and it seems the database dsiconnected on its own and the server wont restart. Any ideas?
More:
My /etc/mysql/my.cnf file contains these relevant lines:
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
bind-address = 127.0.0.1
Okay, after troubleshooting a while, it turned out that the entire file system is read-only. I tried making new files and in each case it says it can't cause "Read-only filesystem"
It seems to be a bad image or some sort of change my VPS provider made. So I'll be contacting them.

I installed mysql 5.1 from the official site, but am having issues

NOTE: I am using Mac OS X Lion
Two issues in particular:
1) The server won't start when I try to start it from the pref pane
2) I get this error when I type "mysql" in the command line. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
When I type mysqld, I get the following error:
120328 17:28:55 [Warning] Can't create test file /usr/local/mysql-5.1.62-osx10.6-x86_64/data/Shaans-MacBook-Pro.lower-test
120328 17:28:55 [Warning] Can't create test file /usr/local/mysql-5.1.62-osx10.6-x86_64/data/Shaans-MacBook-Pro.lower-test
mysqld: Can't change dir to '/usr/local/mysql-5.1.62-osx10.6-x86_64/data/' (Errcode: 13)
120328 17:28:55 [ERROR] Aborting
120328 17:28:55 [Note] mysqld: Shutdown complete
When I type "sudo mysqld", I get the following error:
120328 17:45:48 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql-5.1.62-osx10.6-x86_64/data/ is case insensitive
120328 17:45:48 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
120328 17:45:48 [ERROR] Aborting
120328 17:45:48 [Note] mysqld: Shutdown complete
When I type "sudo mysqld_safe", I get the following response:
120328 17:50:26 mysqld_safe Logging to '/usr/local/mysql/data/Shaans-MacBook-Pro.local.err'.
120328 17:50:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
120328 17:50:32 mysqld_safe mysqld from pid file /usr/local/mysql/data/Shaans-MacBook-Pro.local.pid ended
Use mysqld to start the server - mysql starts the command line interface, not the daemon.
Depending on what distro you have, these commands may work, I use Ubuntu Server 10.04
I type:
sudo service mysql stop
sudo service mysql start
sudo service mysql restart
To perform those functions

Mysql problem: no mysql.sock

Yesterday I was working using MySQL installed on my computer.
I downloaded xampp, so I have I changed on my.cnf file the path to the socket:
/opt/lampp/var/mysql/mysql.sock
That file was just there. Today I wanted to keep working on it, and I found that file is not there anymore, so I am getting the following error while I am starting mysql server:
ERROR 2002 (HY000):
Can't connect to local MySQL server through socket
'/opt/lampp/var/mysql/mysql.sock' (2)
Here are some tests I made:
mujeresponja#ubuntu:~$ ps -fea | grep mysqld
1000 15707 15615 0 16:28 pts/1 00:00:00 grep --color=auto mysqld
mujeresponja#ubuntu:~$ ps -fea | grep mysql
1000 15709 15615 0 16:29 pts/1 00:00:00 grep --color=auto mysql
As a possible solution I uninstalled xampp and reinstall it, and also a new MySQL server, just in case. Anyway, that file is not there anymore.
EDIT
Where the mysql.sock should be, instead there are two files mysql_upgrade_info (Which contains just 5.5.8) and another binary file called ubuntu.err:
mujeresponja#ubuntu:/opt/lampp/var/mysql$ sudo cat ubuntu.err
110403 17:28:52 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:28:52 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:28:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:28:52 InnoDB: Initializing buffer pool, size = 16.0M
110403 17:28:52 InnoDB: Completed initialization of buffer pool
110403 17:28:52 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:28:52 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended
110403 17:29:22 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:29:22 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:29:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:29:22 InnoDB: Initializing buffer pool, size = 16.0M
110403 17:29:22 InnoDB: Completed initialization of buffer pool
110403 17:29:22 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:29:22 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended
(Sorry, I don't know how to show terminal messages in an appropiuate way)
Can anybody help me on this? Thanks in advance!
You can locate the actual socket file and create a symbolic link leading to it as follows:
# check path to socket from mysql settings
mysqladmin | grep d.sock
# create a symbolic link
ln -s path_to_mysql_socket /opt/lampp/var/mysql/mysql.sock
Although the test you did is a bit garbled, Im going to assume that the test just prove mysql isnt running.
Depending on how the mysql configured itself there should be a startup file somewhere, usually around the /etc/rc.* directories, and you would need to run the rc.mysql start (or it could be a S<nn>MySQL in an rc3.d directory for example
I didn't find a certain reason for my problem.
I just unisntalled and reinstalled, and then everything went Ok.
That is not a real solution, but it worked. Good luck
I came in the same situation when I made a grant to *.* to other user. Mysql tried to give permissions over the mysql database and that provoked the disaster: instantly, the mysql.sock file disappeared.
this happened with the version 5.6
I had the same problem with you, and I found some useful information:
2015-08-14 10:51:17 30934 [ERROR] InnoDB: Unable to lock /opt/lampp/var/mysql/ibdata1, error: 11
2015-08-14 10:51:17 30934 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
So, I rebooted the computer and restarted XAMPP, and the problem was resolved.