(已解決)升級碰到MySQL問題 [論壇 - 伺服器架設]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

(1) 2 3 »


(已解決)升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
我的伺服器和desktop共用,今天升級12.04時,過程中出現MySQL問題,升級之後無法連結資料庫。

錯誤訊息如下:
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative user. This may have happened because the account already has a password, or because of a communication problem with the MySQL server.

You should check the account's password after the package installation.

Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.

請問該如何排除問題?

我資料庫都有備份之後再升級。

2012/7/2 0:39
應用擴展 工具箱
回覆: 升級碰到MySQL問題

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70865
EXP: 24
離線
phpMyAdmin
從同一臺電腦 http://127.0.0.1/phpMyAdmin
或從 同一區網電腦 http://安裝mysql的區網IP/phpMyAdmin
或從 internet 電腦 http://安裝mysql的 public IP/phpMyAdmin

從 phpMyAdmin 網頁登入
去 重新檢視 mySQL 使用者及密碼

2012/7/2 7:06
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
謝謝您的回覆。

phpMyAdmin可以連上,用外部也可以連上,但是會顯示

#2002 - 服务器没有响应 (或者本地 MySQL 服务器的套接字没有正确配置)

我google修改了一下
config.inc.php 中
$cfg['Servers'][$i]['host'] = ’localhost’;
改成 $cfg['Servers'][$i]['host'] = '127.0.0.1';
添加
$cfg['Servers'][$i]['hide_db'] = 'information_schema';

之後顯示
#2003 - 服务器没有响应

MySQL沒有跑。

用sudo /etc/init.d/mysql start 啟動
會顯示

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
start: Job failed to start

用service mysql start 啟動
會顯示
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.63" (uid=1000 pid=7034 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

2012/7/2 7:47
應用擴展 工具箱
回覆: 升級碰到MySQL問題

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70865
EXP: 24
離線
我google修改了一下
config.inc.php 中
$cfg['Servers'][$i]['host'] = ’localhost’;
改成 $cfg['Servers'][$i]['host'] = '127.0.0.1';

你這個 維持 localhost 就好
沒改 沒關係
sudo /etc/init.d/mysql start
sudo service mysql start

早期的 常駐記憶體的 服務 都是使用
/etc/init.d/指令 start|stop|restart

現在逐漸 改爲
sudo service 服務名稱 start|stop|restart

sudo start|stop|restart 服務名稱
來啓動

如果你希望 開機就自動啓動
ApacheMySQLPHP

2012/7/2 8:14
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
我的MySQL應該是沒有啟動
sudo -u mysql mysqld
會顯示
120702 8:22:36 [Note] Plugin 'FEDERATED' is disabled.
120702 8:22:36 InnoDB: The InnoDB memory heap is disabled
120702 8:22:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120702 8:22:36 InnoDB: Compressed tables use zlib 1.2.3.4
120702 8:22:36 InnoDB: Initializing buffer pool, size = 128.0M
120702 8:22:36 InnoDB: Completed initialization of buffer pool
120702 8:22:36 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 6245622941
120702 8:22:36 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 6247329654
120702 8:22:36 InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 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
120702 8:22:36 InnoDB: Waiting for the background threads to start
120702 8:22:37 InnoDB: 1.1.8 started; log sequence number 6247329654
120702 8:22:37 InnoDB: Assertion failure in thread 2803891008 in file trx0purge.c line 829
InnoDB: Failing assertion: purge_sys->purge_trx_no <= purge_sys->rseg->last_trx_no
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
120702 8:22:37 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
120702 8:22:37 [Note] - '127.0.0.1' resolves to '127.0.0.1';
120702 8:22:37 [Note] Server socket created on IP: '127.0.0.1'.
00:22:37 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346063 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
mysqld(my_print_stacktrace+0x33)[0x6205c3]
mysqld(handle_fatal_signal+0x484)[0x4cd004]
[0x132400]
mysqld(+0x53a268)[0x6e6268]
mysqld(+0x60c939)[0x7b8939]
mysqld(+0x602afe)[0x7aeafe]
mysqld(+0x53c3e1)[0x6e83e1]
mysqld(+0x52bdbe)[0x6d7dbe]
mysqld(+0x5305f1)[0x6dc5f1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d4c)[0x193d4c]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xdd1ace]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

2012/7/2 8:26
應用擴展 工具箱
回覆: 升級碰到MySQL問題

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70865
EXP: 24
離線
如果你希望 開機就自動啓動
1. ApacheMySQLPHP

重新檢視一下 升級後的版本 有沒有新的內容應注意
2. MySQL
3. phpMyAdmin

2012/7/2 8:55
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
我的MySQL用各種指令都無法啟動。
資料庫都有備份,想重灌。
重灌要不要先移除?
要注意什麼?

2012/7/2 9:22
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24802
EXP: 86
離線
yunol 寫到:
錯誤訊息如下:
Unable to set password for the MySQL "root" user
An error occurred while setting the password for the MySQL administrative user. This may have happened because the account already has a password, or because of a communication problem with the MySQL server.

You should check the account's password after the package installation.

Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.


看來很像是 root 的 password 沒設定好的問題。

試看看它寫的有沒有效

http://www.hkcode.com/linux-bsd-notes/531

2012/7/2 9:54
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
查網路有人說,如果不解決問題,可能重灌還是會出現一樣訊息。
啟動mysql
mysql start
出現錯誤訊息
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

2012/7/2 10:12
應用擴展 工具箱
回覆: 升級碰到MySQL問題
會員二級
註冊日期:
2010/4/17 14:26
所屬群組:
已註冊使用者
等級: 7
HP : 0 / 157
MP : 23 / 6170
EXP: 28
離線
有人回覆,謝謝,我先來試試看。

有可能是密碼沒設定好,升級過程有問到mysql密碼,不記得是要重設還是要我輸入原密碼,我輸入原密碼,就在快要升級完成時出現的錯誤訊息。

2012/7/2 10:15
應用擴展 工具箱

(1) 2 3 »

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.