Linux下安裝MySQL中一些錯誤的解決方案

來源:互聯網
上載者:User

1。在安裝Mysql*.rpm 包時提試錯誤

error: Failed dependencies:
perl(CGI) is needed by MySQL-client-4.0.26-0
perl(DBI) is needed by MySQL-client-4.0.26-0
error: Failed dependencies:
perl(DBI) is needed by MySQL-server-4.0.26-0
主要是因為缺少mysql組件造成的,在安裝linux時,如何安裝了相映的
組件就不會發生這種情況~可以,在光碟片中找到以下rpm 包,安裝就可以
解決,也可以在增加/刪除程式中,安裝myql服務中安裝。

perl DB_File-1.804-88
postgresql-libs-7.3.2-3
postgresql-7.3.2-3
postgresql-server-7.3.2-3
perl-CGI-2.81-88.i386.rpm
測試,解決
2。mysql之後出現的問題如下:啟動
[root@localhost bin]# ./mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket

’/tmp/mysql.sock’ (2)
解決方案:
#chown -R mysql:mysql /var/lib/mysql
[root@localhost beinan]# /etc/init.d/mysqld start
啟動 MySQL: [ 確定 ] 成功解決

3.解決mysql“Access denied for user ’root’@’localhost’”
錯誤1
Enter password:
ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password:

YES)
錯誤2
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password:

NO)
解決方案:
方法一:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <輸入新設的密碼newpassword> 測驗成功

mysql>

解決方案二:
直接使用/etc/mysql/debian.cnf檔案中[client]節提供的使用者名稱和密碼:
# mysql -udebian-sys-maint -p
Enter password: <輸入[client]節的密碼>
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit

# mysql -uroot -p
Enter password: <輸入新設的密碼newpassword>

mysql>

解決方案三:(沒有測試)
# mysql -uroot -p
Enter password: <輸入/etc/mysql/debian.cnf檔案中[client]節提供的密碼>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.