chenyaos-MacBook-Pro:~ chenyao$ sudo lsof -i -P -n | grep 3306
mysqld 132 _mysql 55u IPv6 0x690a48ae77d3dc85 0t0 TCP *:3306 (LISTEN)
chenyaos-MacBook-Pro:~ chenyao$ sudo lsof -i tcp:3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 132 _mysql 55u IPv6 0x690a48ae77d3dc85 0t0 TCP *:mysql (LISTEN)
chenyaos-MacBook-Pro:~ chenyao$ sudo kill 132
chenyaos-MacBook-Pro:~ chenyao$
chenyaos-MacBook-Pro:~ chenyao$ sudo lsof -i tcp:3306
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld 30498 _mysql 29u IPv6 0x690a48ae824dc965 0t0 TCP *:mysql (LISTEN)
发现mysql杀不尽,关闭下面这个操作:
chenyaos-MacBook-Pro:~ chenyao$ sudo launchctl unload -w /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
chenyaos-MacBook-Pro:~ chenyao$
chenyaos-MacBook-Pro:~ chenyao$
chenyaos-MacBook-Pro:~ chenyao$ docker run -p 3306:3306 --name emma_mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:8.0
df209049bb1abe1b648429f42b2f237e39197071de5e06fbdf5e7428f6309e1f
chenyaos-MacBook-Pro:~ chenyao$
image.png
chenyaos-MacBook-Pro:~ chenyao$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df209049bb1a mysql:8.0 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp emma_mysql
chenyaos-MacBook-Pro:~ chenyao$ sudo docker exec -i -t df209049bb1a /bin/bash
root@df209049bb1a:/# cd /etc/mysql/my.cnf
root@df209049bb1a:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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>
image.png
网友评论