1

Whenever I type "mysql.server start" on OSX terminal I get this error:

Maria-MacBook-Pro:~ mariakocsis$ mysql.server start Starting MySQL ./usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 647: /var/lib/mysql/Maria-MacBook-Pro.local.err: No such file or directory Logging to '/var/lib/mysql/Maria-MacBook-Pro.local.err'. 2018-05-31T12:12:39.6NZ mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. /usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144: /var/lib/mysql/Maria-MacBook-Pro.local.err: No such file or directory ERROR! The server quit without updating PID file (/var/lib/mysql/Maria-MacBook-Pro.local.pid). Maria-MacBook-Pro:~ mariakocsis$ sudo chmod -R 777 /usr/local/mysql/ chmod: /usr/local/mysql/: No such file or directory Maria-MacBook-Pro:~ mariakocsis$

Even if I try to run mysql by MAMP, its not working.

Before the error I followed this commands: cd ; nano .bash_profile

/usr/local/mysql/bin/mysql -v

/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe ; exit;

source ~/.bash_profile mysql -v

in your terminal type in: mysql

source ~/.bash_profile mysql -v

SHOW GLOBAL VARIABLES LIKE 'PORT';

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7

sudo nano /etc/my.cnf

How can I reset this things? And how I can start mysql server?

1 Answers1

0

Use command below: To start mysql: mysqld start To stop mysql: mysqld stop To restart: mysqld restart

Pa6
  • 65
  • 1
  • 12
  • I got this...:mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 - No such file or directory) 2018-05-31T12:48:21.913827Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2018-05-31T12:48:21.914004Z 0 [Note] --secure-file-priv is set to – István Bencze May 31 '18 at 12:50
  • NULL. Operations related to importing and exporting data are disabled 2018-05-31T12:48:21.914044Z 0 [Note] mysqld (mysqld 5.7.22) starting as process 5277 ... 2018-05-31T12:48:21.916481Z 0 [Warning] Can't create test file /var/lib/mysql/Maria-MacBook-Pro.lower-test 2018-05-31T12:48:21.916504Z 0 [Warning] Can't create test file /var/lib/mysql/Maria-MacBook-Pro.lower-test 2018-05-31T12:48:21.916581Z 0 [ERROR] failed to set datadir to /var/lib/mysql/ 2018-05-31T12:48:21.916587Z 0 [ERROR] Aborting – István Bencze May 31 '18 at 12:50
  • 2018-05-31T12:48:21.916594Z 0 [Note] Binlog end 2018-05-31T12:48:21.916645Z 0 [Note] mysqld: Shutdown complete – István Bencze May 31 '18 at 12:51
  • for mysqld start – István Bencze May 31 '18 at 12:51
  • what do u get it u type mysql -u root -p – Pa6 May 31 '18 at 13:07
  • Maria-MacBook-Pro:~ mariakocsis$ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Maria-MacBook-Pro:~ mariakocsis$ – István Bencze May 31 '18 at 13:26
  • use mysql.server start for starting and check this solution https://stackoverflow.com/questions/15450091/for-a-newbie-error-2002-hy000-cant-connect-to-local-mysql-server-through-so – Pa6 Jun 01 '18 at 08:55