啟動mysql時報錯的解決(mysql 5.0.45 redhat as 43)
啟動mysql時報錯:
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
071112 00:22:06 mysqld ended
檢視日誌:
#less /var/log/mysqld.log
其中有一段如下:
071112 0:22:06 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
071112 0:22:06 [ERROR] Can't start server: can't create PID file: No such file or directory
071112 00:22:06 mysqld ended
#cd /var/run/
#ls
mysqld目錄不存在,建立它:
#mkdir /var/run/mysqld
#cd /var/run/mysqld
建立檔案mysqld.pid:
#touch mysqld.pid
#cd..
#chown -R mysql mysqld .
#cd /usr/local/mysql/
#bin/mysqld_safe --user=mysql &
nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
能正常啟動
#bin/mysqladmin -u root password root
又出錯
[root@localhost mysql]# bin/mysqladmin -u root password root
bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
[root@localhost mysql]# bin/mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
分析:是/tmp/mysql.sock 不存在
# cd /var/lib/mysql/
由於mysql 預設的mysql.sock 是在/var/lib/mysql/mysql.sock,建立符號連線:
# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
# bin/mysql -u root
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.0.45 MySQL Community Server (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql>
修改root 密碼
#cd /usr/local/mysql/
#bin/mysqladmin -u root -p password yourpassword
一切ok。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/37724/viewspace-152665/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- service mysql start出錯,mysql啟動不了,解決mysql: unrecognized service錯誤MySqlZed
- MySQL 啟動服務報錯解決方案MySql
- IDEA啟動時報Failed to create JVM錯誤的解決IdeaAIJVM
- MySQL create function時報錯MySqlFunction
- redhat5_10g 啟動時報錯ORA-00600Redhat
- mysql 啟動錯誤MySql
- 【MySQL】解決mysql的 1594 錯誤MySql
- 解決MySQL啟動時萬惡的1067錯誤(轉)MySql
- 解決MySQL啟動時萬惡的的“1067”錯誤(轉)MySql
- mysql啟動時報錯Can't read from messagefile errmsg.sysMySql
- [MySQL] “MySQL 服務無法啟動”原理及解決方法MySql
- 練習專案npm start啟動時報錯的個人解決辦法NPM
- 解壓啟動MySQLMySql
- php在iis上配置時報mysql_connect錯誤解決辦法PHPMySql
- mysql(mariadb)啟動失敗解決方法MySql
- Charles 用不了,Charles 開啟時報錯的解決方案
- mysql服務啟動1053錯誤如何解決MySql
- 啟動mysql時顯示:/tmp/mysql.sock 不存在的解決方法MySql
- linux mysql無法啟動怎麼解決?LinuxMySql
- mysql不能啟動如何解決MySql
- 記一次mysql無法啟動的解決方案MySql
- mysql與php錯誤解決MySqlPHP
- mysql錯誤解決總結MySql
- MySQL 啟動報錯 Table 'mysql.plugin' doesn't existMySqlPlugin
- 啟動mysql伺服器出錯MySql伺服器
- MySQL 授權時報錯 ERROR 1819MySqlError
- 解決MySQL server has gone away錯誤的解決方案MySqlServerGo
- CentOS 7下MySQL服務啟動失敗的解決思路CentOSMySql
- 啟動em時報錯:OC4J Configuration issue解決辦法
- mysql安裝/啟動報錯彙總MySql
- mysql 啟動MySql
- MYSQL中 TYPE=MyISAM 錯誤的解決方法MySql
- 【MySQL】mysql啟動報錯./mysqld_safe: my_print_defaults: not foundMySql
- MYSQL啟動後報:ERROR! The server quit without updating PID file錯誤的問題解決MySqlErrorServerUI
- 開機後mysql服務未啟動問題解決MySql
- MySQL入門學習之——MySQL錯誤解決彙總MySql
- MySQL簡介與啟動MySqlMySql
- mysql 啟動報錯Can't connect to local MySQL server through socket '/data/mysql/mysql/mysql.sock'(111)MySqlServer