Today, use the shell to log in to MySQL directly, and the error is as follows
liup@ubuntu :~$ mysql
Warning: World-writable config file ‘/etc/mysql/my. cnf’ is ignored
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
‘/etc/my.cnf’ is ignored, which probably means that the permissions are globally writable and any user can write. mysql is worried about such files being maliciously modified by other users, so it ignores this configuration file. This makes it inaccessible, which is one of mysql’s security mechanisms. So we have to change some permissions. Set other users not writeable.
The shell is as follows
chmod 644 /etc/my.cnf
Then execute:
service mysql restart
Similar Posts:
- How to Solve MySQL Startup error: mysql-bin.index not found (Errcode: 13)
- How to Solve MYSQL Error: Can’t create test file xxx lower-test
- Solution to the error of MySQL: unrecognized service (CentOS)
- CentOS7 MYSQL Connect Error: [ERROR] InnoDB: The innodb_system data file ‘ibdata1’ must be writable
- MySQL Error: The server quit without updating PID file [How to Solve]
- [Solved] MYSQL Export Sheet Error: –secure-file-priv option so it cannot execute this statement
- [Solution] mysql Unknown storage engine ‘InnoDB’
- MySQL installation error — failed to find valid data directory
- How to Solve MYSQL Startup Error: “MySQL Daemon failed to start”
- [Solved] 1146 – Table ‘performance_schema.session_variables’ doesn’t exist