Article transferred from https://www.cnblogs.com/mujingyu/p/7689116.html
Question 1:my-default.cnf
Notice 5.7.23 no my-default.cnf.
CNF file Template
[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
Socket=/var/lib/mysql/mysql.sock
[Mysqld]
#skip-name-resolve
#设置3306端口
Port = 3306
Socket=/var/lib/mysql/mysql.sock
# set up the MySQL installation directory
Basedir=/usr/local/mysql
# Set up a storage directory for MySQL database data
Datadir=/usr/local/mysql/data
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb
#lower_case_table_name =1
max_allowed_packet=16m
So you can create it yourself and copy it to/ETC/MY.CNF.
Question 2:
You can see that the problem is Mysqld_safe Directory '/var/lib/mysql ' for UNIX socket file don ' t exists
Create this file
Mkdir/var/lib/mysql
chmod 777/var/lib/mysql/
Linux installation MYSQL-5.7.23-LINUX-GLIBC2