MySQL5.6:mysql_secure_installation 報錯ERROR 2002 (HY000)
mysql在修改data_dir之後,執行mysql_secure_installation會報如下錯誤
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
解決方法:
修改mysql_secure_installation檔案,大約150行,在sub make_config定義中加入 "socket=/data/mysql/mysql.sock",修改完成如下
sub make_config {
my $password = shift;
my $esc_pass = basic_single_escape($rootpass);
write_file($config,
"# mysql_secure_installation config file",
"[mysql]",
"user=root",
"password='$esc_pass'",
"connect-expired-password",
"socket=/data/mysql/mysql.sock");
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29757574/viewspace-2137094/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- Error!: SQLSTATE[HY000] [2002] Connection refusedErrorSQL
- ERROR2002(HY000):CantconnecttolocalMySQLserverthroughsocket的解決方法ErrorMySqlServer
- mysql執行sql指令碼報錯ERROR 1366 (HY000) 解決MySql指令碼Error
- super許可權報錯:ERROR1221(HY000):IncorrectusageofDBGRANTandGLOBALPRIVILEGESError
- linux下連線mysql報錯ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysqLinuxMySqlErrorServer
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- mysql 5.6.25報錯ERROR 1372 (HY000): Password hash 的一點思考MySqlError
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- ERROR 2002 (HY000): Can't connect server socket /tmp/mysql.sockErrorServerMySql
- MySQL建立使用者報錯 ERROR 1396 (HY000): Operation CREATE USER failed for 'afei'@'%'MySqlErrorAI
- mysql5.6 mysqldump備份報錯MySql
- ERROR 2002(HY000):Can't connect to local MySQL socket '/tmp/mysql.sock'ErrorMySql
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解決方法ErrorMySqlServer
- ERROR 2002 (HY000): Can't connect server socket /var/run/mysqld/mysqld.sockErrorServerMySql
- ERROR 2002Error
- Percona MySQL 5.6 語句加鎖報錯"ERROR 1665 (HY000): Cannot execute statement"MySqlError
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- mysql 8 報錯 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryMySqlErrorAIStruct
- mysql匯入sql檔案報錯 ERROR 2013 2006 2002MySqlError
- vipca報錯 Error 0PCAError
- 24.2.SQLSTATE[HY000][2002]NosuchfileordirectorySQL
- MySQL 5.7 建立使用者報錯 ERROR 1805 (HY000): Column count of mysql.user is wrongMySqlError
- docker phpmyadmin 連線宿主mysql資料庫報錯:mysqli::real_connect(): (HY000/2002): Connection refusedDockerPHPMySql資料庫
- ERROR 1045 (28000): ProxySQL Error: 報錯ErrorSQL
- MYSQL SOURCE報錯 ERROR: ASCIIMySqlErrorASCII
- ERROR 1010 (HY000): Error dropping databaseErrorDatabase
- MySQL5.7叢集(MGR)啟動報ERROR 3092 (HY000)MySqlError
- 阿里雲mysql遠端登入報ERROR 2027(HY000)阿里MySqlError
- ERROR 1524 (HY000): Plugin is not loadedErrorPlugin
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- mysql報錯ERROR 1093MySqlError
- 【Redis】slaveof 報錯 Background transfer errorRedisError
- Oracle安裝報錯syntax errorOracleError
- struts2報Error filterStart錯ErrorFilter
- 網站報錯:“Database Server Error”網站DatabaseServerError
- Centos7-mysql執行報錯ERROR1820(HY000):YoumustresetyourpasswordusingALTERUSERstatementbeforeexecutingthisstatement.CentOSMySqlError