How to deal with mysql8.0 without port
Editor to share with you how to deal with mysql8.0 without a port. I hope you will gain a lot after reading this article. Let's discuss it together.
Mysql8.0 has no port solution: first go directly to "system preferences-> mysql- > initialize Database", then output the password, and finally reinitialize the mysql.
Mac resolved the problem that the port was 0 after MySql (8.0.20) started and could not connect to Workbench.
Problem 1: my.cnf is not set
If the my.cnf configuration is not set, there will be account password login failure
MySql cannot be started or shut down in the system preference configuration
Resolve the configuration of my.cnf to / etc/my.cnf
Question 2: check that the port number is 0
Mysql > show global variables like 'port'; ±- + | Variable_name | Value | ±- ±- + | port | 0 | ±- ±- + mysql > SHOW VARIABLES LIKE' skip_networking' ±- ±- + | Variable_name | Value | ±- ±- + | skip_networking | OFF | ±- +
Let's start with the solution:
Go directly to system preferences-- > mysql-- > initialize Database, and then output the password to reinitialize mysql
one
Results:
±- ±- + | Variable_name | Value | ±- ±- + | port | 3306 | ±- +
You can also try the methods you have tried.
First check SHOW VARIABLES LIKE 'skip_networking'; if you report skip_networking = On, your mysqld starts without network support (causing the value in the port system variable to be 0).
If that's the case, you'll probably have to check mysqld's init script, most likely under / etc/init.d/mysql, where you search for-skip-networking and comment out (delete) this section. After completing this procedure, you must restart mysqld.
Or whether skip_networking is enabled in my.cnf, and comment out if so.
It is not necessary for Normaly to explicitly set port 3306 because 3306 is the default port for mjysqld snooping.
There is another solution:
/ System/Library/LaunchDaemons/org.mysql.mysqld ProgramArguments / opt/local/lib/mariadb-10.1/bin/mysqld-skip_networking=0-- socket=/opt/local/var/run/mariadb-10.1/mysqld.sock-- user=mysql-- port=3306-- datadir=/opt/local/var/db/mariadb-10.1-- pid -file=/opt/local/var/run/mariadb-10.1/dns.local.pid finished reading this article. I believe you have a certain understanding of how to deal with mysql8.0 without a port. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!