1. When executing mysqldump command for data backup, the error information is as follows:
~ % mysqldump -udbuser -p123456 -h127.0.0.1 school student > school_student.sql
mysqldump: Got error: 2002: "Can't connect to server on '127.0.0.1' (36)" when trying to connect
2. Then try the command line to connect to the database, which is also an error
~ % mysql -udbuser -p123456 -h127.0.0.1
ERROR 2002 (HY000): Can't connect to server on '127.0.0.1' (36)
3. After checking the MySQL service result, I remembered that I used ‘mysql. Server start’ to start the database. This cannot follow the system startup. Each time I restart the Mac, I need to run it manually. You can use brew services to start MariaDB Start the service with the system.
~ % mysql.server start
Starting MariaDB
.211111 16:04:44 mysqld_safe Logging to '/usr/local/var/mysql/xiaokang.err'.
211111 16:04:44 mysqld_safe Starting mariadbd daemon with databases from /usr/local/var/mysql
SUCCESS!
4. After successful restart, execute mysqldump again for backup
Read More:
- [Solved] MYSQL Command Execute Error: Can ‘t connect to local MySQL server through socket ‘/tmp/mysql.sock ‘(2) “
- [Solved] mysqldump: Got error: 1556: “You can‘t use locks with log tables.“ when using LOCK TABLES
- MySql Install Error: Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- How to Solve can‘t connect to local mysql server through socket ‘/var/lib/mysql/mysql.sock‘
- host ‘‘ is not allowed to connect to this mysql server Connect MYSQL Error
- Mysqldump: Got error: 1045: Access denied for user ‘root‘@‘localhost‘
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
- Remote connection to MySQL database error: is not allowed to connect to this MYSQL server solution
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- mysqldump: Error: Binlogging on server not active [How to Solve]
- [Solved] Error: ER_HOST_NOT_PRIVILEGED: Host ‘x.x.x.x‘ is not allowed to connect to this MySQL server
- [Solved] Anaconda Error: pyqt can’t use QSqlDatabase to connect to MySQL
- Idea connect mysql error Server returns invalid timezone. Go to’Advanced’ tab and set’serverTimezone’ property
- [Solved] Sphinx macos sql_connect: failed to load libmysqlclient
- MySQL Install Error: MySQL error 1042: Unable to connect to any of the specified MySQL hosts
- [Solved] mysqldump: Error: ‘Access denied; you need (at least one of) the PROCESS privilege(s) for this opera