When I start mysql using System Preferences>MySQL>StartMySQLServer
, then I can do this:
/usr/local/mysql-5.7.10-osx10.9-x86_64/bin$ ./mysql -uroot -p
Enter password: <password shown me during installation>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.10
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'my new password';
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.01 sec)
mysql>
And I can see the mysql process created by System Preferences>MySQL>StartMySQLServer
:
/Library/LaunchDaemons$ ps -e | grep mysql
1735 ?? 0:00.31 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid
1743 ttys000 0:00.00 grep mysql
/Library/LaunchDaemons$
But after stopping the server using System Preferences>MySQL
, I am unable to start the mysql server using the command line (following the instructions in the docs):
/usr/local/mysql-5.7.10-osx10.9-x86_64/bin$ sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
/usr/local/mysql-5.7.10-osx10.9-x86_64/bin$ ./mysql -uroot -p
Enter password: <new password>
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
There's no mysql process:
/usr/local/mysql-5.7.10-osx10.9-x86_64/bin$ ps -e | grep mysql
1920 ttys001 0:00.00 grep mysql
/usr/local/mysql-5.7.10-osx10.9-x86_64/bin$
How are you supposed to start the mysql server from the command line?