can't create PID file問題處理
今天在啟動MYSQL資料庫時,報如下錯誤:
[root@ora10g mysql]# ./bin/mysqld_safe --user=mysql &
[1] 4005
[root@ora10g mysql]# 101209 16:37:19 mysqld_safe Logging to '/var/log/mysqld.log'.
[root@ora10g mysql]# 101209 16:37:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@ora10g mysql]#
[root@ora10g mysql]#
[root@ora10g mysql]# 101209 16:37:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done ./bin/mysqld_safe --user=mysql
[root@ora10g mysql]#
[root@ora10g mysql]#
[root@ora10g mysql]# more /var/run/mysqld/mysqld.pid
/var/run/mysqld/mysqld.pid: No such file or directory
[root@ora10g mysql]# more /var/log/mysqld.log
101209 16:37:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101209 16:37:20 InnoDB: The InnoDB memory heap is disabled
101209 16:37:20 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
101209 16:37:20 InnoDB: Compressed tables use zlib 1.2.3
101209 16:37:20 InnoDB: Initializing buffer pool, size = 128.0M
101209 16:37:20 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
101209 16:37:21 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
101209 16:37:22 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
101209 16:37:22 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
101209 16:37:24 InnoDB: Waiting for the background threads to start
101209 16:37:25 InnoDB: 1.1.5 started; log sequence number 0
101209 16:37:25 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
101209 16:37:25 [ERROR] Can't start server: can't create PID file: No such file or directory
101209 16:37:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
從表面上來看,這應該是訪問許可權不夠,確認:
1、到/var/run目錄下檢視:
[root@ora10g mysql]# cd /var/run
[root@ora10g run]# ls -l mysqld*
ls: mysqld*: No such file or directory
2、建立該目錄,並將其許可權賦給mysql使用者
[root@ora10g run]# mkdir mysqld
[root@ora10g run]# cd mysqld
[root@ora10g mysqld]# ls -l
total 0
[root@ora10g mysqld]# cd ..
[root@ora10g run]# chown -R mysql:mysql /var/run/mysqld
[root@ora10g run]#
3、啟動mysql資料庫程式
[root@ora10g run]# cd /usr/local/mysql
[root@ora10g mysql]# bin/mysqld_safe --user=mysql &
[1] 4350
[root@ora10g mysql]# 101209 16:46:00 mysqld_safe Logging to '/var/log/mysqld.log'.
101209 16:46:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
4、確認
[root@ora10g mysql]# tail -10f /var/log/mysqld.log
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1595675
101209 16:46:00 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
101209 16:46:00 InnoDB: 1.1.5 started; log sequence number 1595675
101209 16:46:00 [Note] Event Scheduler: Loaded 0 events
101209 16:46:00 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.9' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[root@ora10g mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.9 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> \q
Bye
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12350275/viewspace-689321/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 小白:關於處理“can't find '__main__' module in ”這個問題的詳細處理方式!AI
- Can't open file: (errno: 24)
- 使用System.IO.File.Create()時注意的問題
- 【問題處理】ORA-01113 file xxx need media recovery
- 【問題處理】ORA-00376 file xx cannot be read at this time
- Fatal error: can't check configuration file '/home/watt/proxy/dError
- [ERR] 1231 - Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'SQL
- 問題解決zipimport.ZipImportError: can‘t decompress data; zlib not availablImportErrorAI
- 解決問題:Variable 'time_zone' can't be set to the value of 'NULL'Null
- 【故障處理】Linux下匯入匯出“IMP-00030: failed to create file ... for write”LinuxAI
- GTID複製報錯處理:Last_Error: Error 'Can't drop database 'test';ASTErrorDatabase
- mysqld: Can‘t create directory ‘E:\Software\mysql-5.7.24-winx64\data\‘ (Errcode: 2 - NoMySql
- Docker 掛載許可權 chcon: can't apply partial context to unlabeled fileDockerAPPContext
- Linux安裝mysql出現ERROR! The server quit without updating PID file問題解決LinuxMySqlErrorServerUI
- Oracle RAC+ADG新增資料檔案失敗處理(db_create_file_dest)Oracle
- golang json處理問題GolangJSON
- [git] git問題處理Git
- PostgreSQL異常重啟postmaster.pid處理SQLAST
- create index ORA-00376 處理方法Index
- 併發問題處理方式
- Linux 問題處理集錦Linux
- 處理SQLServer errorlog滿問題SQLServerError
- 資料處理--pandas問題
- Ubuntu處理依賴問題Ubuntu
- ORA-19815: WARNING: db_recovery_file_dest_size閃回區爆滿問題處理
- MySQL The server quit without updating PID file xx/var/DESKTOP-BHVUG0D.pidMySqlServerUI
- Navicat 連線 MySQL 失敗:2002-can‘t connect to server on localhost(10061)問題解決MySqlServerlocalhost
- TypeError: can‘t concat str to bytesError
- PHP 開發版本問題處理PHP
- 【故障處理】TNS-04610問題
- JVM問題分析處理手冊JVM
- gc buffer busy acquire問題處理GCUI
- oracle SP2-問題處理Oracle
- 記憶體分配問題處理記憶體
- 如何處理 No DMARC Record Found 問題
- 如何處理HTTP 503故障問題?HTTP
- MySQL:亂碼問題處理流程MySql
- 【問題處理】IPC Send timeout detected
- log file sync等待事件處理思路事件