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]節提供的密碼>