Install cannot change owner and permissions of var/run/mysqld No such file or directory

I am running Ubuntu 15.04 which recently upgraded to MySQL 5.6. Ever since then, it's been unable to start on boot because /var/run/mysqld doesn't exist. Doing a sudo service mysql start just hangs. Creating the directory and assigning mysql:root and 755 as permissions allows mysql to start, but the folder is destroyed on every reboot.

Whenever /var/run/mysqld doesn't exist, these lines show up in /var/log/mysql/error.log:
==========================================================================
2015-03-24 17:43:15 1178 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2015-03-24 17:43:15 1178 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2015-03-24 17:43:15 1178 [Note] Server socket created on IP: '127.0.0.1'.
2015-03-24 17:43:15 1178 [ERROR] Can't start server : Bind on unix socket: No such file or directory
2015-03-24 17:43:15 1178 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
2015-03-24 17:43:15 1178 [ERROR] Aborting

systemctl status mysql shows:
==========================================================================
Mar 24 22:43:33 benxiao-ubuntu01 systemd[1]: Starting MySQL Community Server...
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: 150324 22:43:33 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: 150324 22:43:33 mysqld_safe Logging to '/var/log/mysql/error.log'.
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: mkdir: cannot create directory ‘/var/run/mysqld’: Permission denied
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: chown: cannot access ‘/var/run/mysqld’: No such file or directory
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: chmod: cannot access ‘/var/run/mysqld’: No such file or directory
Mar 24 22:43:33 benxiao-ubuntu01 mysqld_safe[1030]: 150324 22:43:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: mysql-server-5.6 5.6.23-1~exp1~ubuntu4
ProcVersionSignature: Ubuntu 3.19.0-10.10-generic 3.19.2
Uname: Linux 3.19.0-10-generic x86_64
ApportVersion: 2.16.2-0ubuntu4
Architecture: amd64
Date: Tue Mar 24 17:47:58 2015
InstallationDate: Installed on 2015-02-15 (37 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20150119)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: mysql-5.6
UpgradeStatus: No upgrade log present (probably fresh install)

I can not start MariaDB because there is no mysqld.sock file in var/run/mysqld/ folder. I have uninstalled and reinstalled.

I have run mysql_install_db, it was apparently successful. When I ran mysqld_safe it had problems. Mysql-secure_installation hangs with an error no such file in mysqld.sock /var/run/mysqld/. Searching for it came up empty, there was no such file anywhere.

I am having trouble with generating a bug report.

My question is how do find, download, or make the missing file. I have searched mysql and googled without any success.

My OS is Ubuntu 11.04

Answer

Try doing:

cd /etc/init.d Go to where mysqld is, and try: ./mysqld start

Then do mysql -uroot and see if you can login.

Also, it would help if you tell us how you installed MariaDB. Thanks!

  • ↑ Starting and Stopping MariaDB ↑

Comments

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.

WSL로 Ubuntu를 깔고나서 Mysql을 받으려고하니깐

mysqld: unrecognized service 오류 ,‘/var/run/mysqld’: No such file or directory 오류

등으로 너무 많은 삽질을 했는데 애초에 WSL에서 사용하는 Ubuntu방식이 달랐다

그 순서는 아래와 같다.

1. wsl을 열고 Ubuntu 패키지 업데이트를 한다.

sudo apt update

2. 업데이트되면 다음을 통해 MySQL을 설치

sudo apt install mysql-server

3. 버전확인해본다

mysql --version

4. MySQL 서버를 시작합니다.

sudo /etc/init.d/mys ql start

5. 보안 스크립트 프롬프트를 시작합니다.

sudo /etc/init.d/mysql start Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? --MySQL 암호의 강도를 테스트하는 데 사용할 수 있는 암호 유효성 검사 플러그 인을 설정할지 여부 Press y|Y for Yes, any other key for No: n Please set the password for root here. --암호 설정 New password: Re-enter new password: By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. --익명 사용자를 제거할지 여부 Remove anonymous users? (Press y|Y for Yes, any other key for No) : n ... skipping. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. --루트 사용자가 로컬 및 원격으로 로그인할 수 있도록 허용할지 여부 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. --테스트 데이터베이스를 제거할지 여부 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. --권한 테이블을 즉시 다시 로드할지 여부 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!

6. Mysql프롬프트가 열리고 (혹시 안열리면 sudo mysql)

7. 사용가능한 데이터베이스를 보려면

SHOW DATABASES; --를입력하면 아래와같은 그림이 나온다 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)