how to

start-on-macos

Mar 21, 2024
softwares-and-toolsmysql
2 Minutes
217 Words

ref (unreliable): https://stackoverflow.com/questions/15450091/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmp-mys

1
~ λ mysql --version
2
mysql Ver 8.3.0 for macos13.6 on arm64 (Homebrew)
  • brew services start mysql or something else to start mysql service.
1
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
  • mysql_secure_installation

  • Next, see the following history:

1
~ λ sudo mysql
2
Password:
3
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
4
~ λ sudo chown -R _mysql:mysql /usr/local/var/mysql
5
6
chown: /usr/local/var/mysql: No such file or directory
7
~ λ sudo mysql.server start
8
9
Starting MySQL
10
. ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/floriandeMacBook-Air.local.pid).
11
~ λ mysql -u root -p h127.0.0.1
12
13
Enter password:
14
ERROR 1049 (42000): Unknown database 'h127.0.0.1'
15
~ λ mysql -u root -p
15 collapsed lines
16
Enter password:
17
Welcome to the MySQL monitor. Commands end with ; or \g.
18
Your MySQL connection id is 12
19
Server version: 8.3.0 MySQL Community Server - GPL
20
21
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
22
23
Oracle is a registered trademark of Oracle Corporation and/or its
24
affiliates. Other names may be trademarks of their respective
25
owners.
26
27
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
28
29
mysql> CREATE USER 'julyfun'@'localhost' IDENTIFIED BY 'guest123';
30
Query OK, 0 rows affected (0.03 sec)
  • You can now install, in vscode, the MySql extension by Wejian Chen.

Better not

  • brew install mysql / mariadb
Article title:start-on-macos
Article author:Julyfun
Release time:Mar 21, 2024
Copyright 2025
Sitemap