[root@freebsd ~]# /usr/local/etc/rc.d/mysql-server start[root@freebsd ~]# mysqlERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)學(xué)習(xí)Freebsd過程中的一些小技巧作者:未知 時(shí)間:2005-09-13 22:50 出處:Blog.ChinaUnix.net 責(zé)編:My FAQ摘要:學(xué)習(xí)Freebsd過程中的一些小技巧mysql 起動(dòng)錯(cuò)誤解決辦法- -Access denied for user‘‘@‘localhost‘ to database ‘mysql‘ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘第一次安裝運(yùn)行以下一句,產(chǎn)生數(shù)據(jù)庫(kù)文件/usr/local/bin/mysql_install_dbchown -R mysql /var/db/mysql啟動(dòng)mysql/usr/local/bin/mysqld_safe &mysql 起動(dòng)錯(cuò)誤解決辦法- -Access denied for user‘‘@‘localhost‘ to database ‘mysql‘ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘第一次安裝運(yùn)行以下一句,產(chǎn)生數(shù)據(jù)庫(kù)文件/usr/local/bin/mysql_install_dbchown -R mysql /var/db/mysql啟動(dòng)mysql/usr/local/bin/mysqld_safe &=====================================apache啟動(dòng)# /usr/local/sbin/apachectl start可以在任何時(shí)候使用下面的命令來(lái)停止服務(wù):# /usr/local/sbin/apachectl stop當(dāng)由于某種原因修改了配置文件之后, 需要重啟服務(wù)器:# /usr/local/sbin/apachectl restart========================================請(qǐng)問你裝的是什么版本?如果是5.4的話,ssh默認(rèn)是不打開的。需要在/etc/rc.conf里面添加sshd_enable="YES"才行的。用SecureCRT 4.1登陸時(shí)設(shè)置Primary的時(shí)候設(shè)為keyboard就行了。5.4的驗(yàn)證方式不能用password[/img]確認(rèn)/etc/ssh/sshd_config里面下列三行前無(wú)#Port 22Protocol 2PasswordAuthentication yes=======================================前幾天有個(gè)帖子有說(shuō)如何不重啟動(dòng)而使網(wǎng)絡(luò)參數(shù)修改生效的方法。/etc/netstart restart================================================最簡(jiǎn)單的用系統(tǒng)自帶的ftpdvi /etc/inetd.conf把 ftpd前的#去掉存盤退出。(ipv6你應(yīng)該用不上第二個(gè)ftpd的#你就不用去了)如果你系統(tǒng)里原先沒有啟動(dòng)inetd的話就用#inetd啟動(dòng)守護(hù)進(jìn)程inetd如果你已經(jīng)啟動(dòng)過了inetd就用 #killall -HUP inetd 從啟動(dòng)inetd給他們一個(gè)賬號(hào)就可以連上你的機(jī)器了,更具體的man ftpd。如果要inetd在下次隨系統(tǒng)啟動(dòng)編輯/etc/rc.conf加入inetd_enable="YES"如果你原先有了就不用再加了。當(dāng)然ports里還提供豐富的ftpd 比如vsftpd pureftpd,配置都不麻煩。=============================================================如果您知道一個(gè)port的準(zhǔn)確名字, 但需要知道在哪個(gè)類別里面能找到它例如:# whereis lsoflsof: /usr/ports/sysutils/lsof還有另外的一個(gè)尋找您需要的port的方法--是用ports collecton 內(nèi)嵌的搜索機(jī)制。要使用這個(gè)搜索, 您需要先到 /usr/ports目錄下面。在那個(gè)目錄里面, 運(yùn)行make search name=program-name, program-name 就是您想尋找的程序名字。 舉個(gè)例子,如果您想找 lsof:# cd /usr/ports# make search name=lsofPort: lsof-4.56.4Path: /usr/ports/sysutils/lsofInfo: Lists information about open files (similar to fstat(1))Maint: obrien@FreeBSD.orgIndex: sysutilsB-deps:R-deps:================================================================ports安裝軟件定位到軟件ports目錄make install clean指定安裝目錄# make PREFIX=/usr/home/example/local install卸載make deinstall============================查找文件find / -name *tbz==============================將pkg_add -r 的下載地址改成ftp://ftp.freebsdchina.orgbash shell#export PACKAGEROOT="
Fedora8啟動(dòng)mysql 報(bào)錯(cuò):ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)1、先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已經(jīng)啟動(dòng).另外看看是不是權(quán)限問題.2、確定你的mysql.sock是不是在那個(gè)位置,mysql -u 你的mysql用戶名 -p -S /var/lib/mysql/mysql.sock3、試試:service mysqld start4、如果是權(quán)限問題,則先改變權(quán)限 #chown -R mysql:mysql /var/lib/mysql[root@localhost ~]# /etc/init.d/mysqld start啟動(dòng) MySQL: [ 確定 ][root@localhost ~]# mysql -uroot -pERROR 2002 (HY000): Can‘t connect to localMySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)原因是,/var/lib/mysql 的訪問權(quán)限問題。shell> chown -R mysql:mysql /var/lib/mysql接著啟動(dòng)服務(wù)器shell> /etc/init.d/mysql start服務(wù)器正常啟動(dòng)后察看 /var/lib/mysql 自動(dòng)生成mysql.sock文件。但是我的問題仍然沒有得到解決。問題終于解決:方法: 修改/etc/my.conf:[mysqld]datadir=/usr/local/mysql/datasocket=/var/lib/mysql/mysql.sock[mysql.server]user=mysqlbasedir=/usr/local/mysqlIf there is not currently a section called [client], add one at the bottom of the file and copy the socket= line under the [mysqld] section such as:[client]socket=/var/lib/mysql/mysql.sock發(fā)現(xiàn)依舊如此,運(yùn)行/etc/init.d/mysql start報(bào)錯(cuò): Starting MySQLCouldn‘t find MySQL manager or server是mysqld服務(wù)沒啟,運(yùn)行/usr/local/mysql/bin/mysqld_safe &問題解決。Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=20399882006-11-27 11:06 banyaoFB6.2rc1下MYsQL啟動(dòng)出錯(cuò)(已解決)[code]root@yao[/usr/ports/databases/mysql51-server]# make install===> mysql-server-5.1.11 cannot install: MySQL versions mismatch: mysql50-client is installed and wanted version is mysql51-client.*** Error code 1Stop in /usr/ports/databases/mysql51-server.root@yao[/usr/ports/databases/mysql51-server]#root@yao[/usr/ports/databases/mysql50-server]# make installroot@yao[/usr/ports/databases/mysql50-server]# /usr/local/etc/rc.d/mysql-server startStarting mysql.root@yao[/usr/ports/databases/mysql50-server]#root@yao[/usr/local/etc]# mysqlERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)root@yao[/usr/local/etc]# mysql -u root -pEnter password:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)root@yao[/usr/local/etc]# find /usr -name my.cnfroot@yao[/usr/local/etc]#[/code]這個(gè)是在另外一臺(tái)機(jī)器上遇到的問題[code]phpMyAdmin - ErrorphpMyAdmin是在官方網(wǎng)上下載的最新版本2.9.1.1cp phpMyadmin /usr/local/www/apache/data目錄下有一個(gè)config.sample.inc.php文件,找把到教程中說(shuō)的config.inc.php 而且里面的內(nèi)容也不想是config.inc.phpfirefox http://localhost/phpadmin瀏覽器中顯示:Fatal error: Call to undefined function preg_replace() in /usr/local/www/apache22/data/phpMyAdmin/libraries/sanitizing.lib.php on line 37[/code][[i] 本帖最后由 大大狗 于 2006-11-27 14:49 編輯 [/i]]2006-11-27 11:15 大大狗可能是mysql.sock的權(quán)限不夠2006-11-27 11:19 大大狗mysql.sock 它是被放在 /tmp/mysql.sock 臨時(shí)文件夾下的,所你可以重新啟動(dòng)一下系統(tǒng)就可以了reboot 在 mysql -u root -p2006-11-27 11:21 大大狗第二個(gè)問題解決方法 [code]出現(xiàn)無(wú)法識(shí)別preg_replace函數(shù)的錯(cuò)誤需要安裝pcre , 位于 /usr/ports/devel/php5-pcre正則表達(dá)式的支持是由 PCRE(Perl Compatible Regular Expression)庫(kù)提供的,這是個(gè)開放源代碼的軟件,作者為 Philip Hazel,版權(quán)屬于英國(guó)劍橋大學(xué)。可于以下地址獲得:ftp://ftp.csx.cam.ac.uk/[/code]2006-11-27 13:57 banyao謝謝,第一個(gè)問題解決拉,第二個(gè)問題,依然是不行,是不是phpMyAdmin缺少了個(gè)config.inc.php配置問題?php5-extensions已經(jīng)ports上去了阿phpMyAdmin - ErrorCannot load session extension. Please check your PHP configuration.2006-11-27 14:01 大大狗/usr/ports/devel/[color=Blue]php5-pcre[/color] 這個(gè)已經(jīng)ports了嗎2006-11-27 14:13 banyao[quote]原帖由 [i]大大狗[/i] 于 2006-11-27 14:01 發(fā)表/usr/ports/devel/[color=Blue]php5-pcre[/color] 這個(gè)已經(jīng)ports了嗎 [/quote]已經(jīng)ports上了,2006-11-27 14:22 banyao重啟系統(tǒng)之后就可以了,謝謝 大大狗版主奇怪怎么我重啟服務(wù)不行,非得要重啟系統(tǒng)才可以http://bbs2.chinaunix.net/archiver/tid-861670.html作者 留言mylcx1028半仙注冊(cè)時(shí)間: 2007-05-17文章: 1
這兩天剛接觸FreeBSD,有問題向大家請(qǐng)教 ^_^我想在系統(tǒng)里裝上mysql下面是安裝步驟:cd /usr/ports/databases/mysql51-server/makemake installmake cleancd work/mysql-5.1.11-betascripts/mysql_install_db出現(xiàn)以下信息:引用:Installing all prepared tablesFill help tablesTo start mysqld at boot time you have to copy support-files/mysql.serverto the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:/usr/local/bin/mysqladmin -u root password ‘new-password‘/usr/local/bin/mysqladmin -u root -h freeBSD.domain password ‘new-password‘See the manual for more instructions.NOTE: If you are upgrading from a MySQL <= 3.22.10 you should runthe /usr/local/bin/mysql_fix_privilege_tables. Otherwise you will not beable to use the new GRANT command!You can start the MySQL daemon with:cd /usr/local ; /usr/local/bin/mysqld_safe &Please report any problems with the /usr/local/bin/mysqlbug script!The latest information about MySQL is available on the web athttp://www.mysql.comSupport MySQL by buying support/licenses athttp://shop.mysql.commysql引用:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)mysql服務(wù)啟動(dòng)不了. : (引用:/usr/local/bin/mysqld_safe &也是和上面一樣的錯(cuò)誤大家請(qǐng)指教.
mylcx1028 寫到:這兩天剛接觸FreeBSD,有問題向大家請(qǐng)教 ^_^我想在系統(tǒng)里裝上mysql下面是安裝步驟:cd /usr/ports/databases/mysql51-server/makemake installmake cleancd work/mysql-5.1.11-betascripts/mysql_install_db出現(xiàn)以下信息:引用:Installing all prepared tablesFill help tablesTo start mysqld at boot time you have to copy support-files/mysql.serverto the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:/usr/local/bin/mysqladmin -u root password ‘new-password‘/usr/local/bin/mysqladmin -u root -h freeBSD.domain password ‘new-password‘See the manual for more instructions.NOTE: If you are upgrading from a MySQL <= 3.22.10 you should runthe /usr/local/bin/mysql_fix_privilege_tables. Otherwise you will not beable to use the new GRANT command!You can start the MySQL daemon with:cd /usr/local ; /usr/local/bin/mysqld_safe &Please report any problems with the /usr/local/bin/mysqlbug script!The latest information about MySQL is available on the web athttp://www.mysql.comSupport MySQL by buying support/licenses athttp://shop.mysql.commysql引用:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)mysql服務(wù)啟動(dòng)不了. : (引用:/usr/local/bin/mysqld_safe &也是和上面一樣的錯(cuò)誤大家請(qǐng)指教. :oops:/usr/local/bin/mysql_install_db --user=mysql試試_________________如果大海能夠喚回曾經(jīng)的愛,就讓我用一生等待;如果深情往事你已不再留戀,就讓他隨風(fēng)飄遠(yuǎn);如果大海能夠帶走我的哀愁,就像帶走每條河流,所有受過的傷,所有流過的淚,我的愛,請(qǐng)全部帶走返回頁(yè)首