錯誤一: 代碼如下複製代碼 File "/usr/lib/pymodules/python2.6/MySQLdb/__init__.py", line 81, in Connectreturn Connection(*args, **kwargs)File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 170, in
1、安裝好wamp後,運行WampServer程式,進入MYSQL控制台; 2、進入控制台後,提示輸入密碼(不用輸入任何密碼,因為密碼為空白),按斷行符號鍵進入;3、輸入“USE mysql;”然後斷行符號,意思是選擇mysql資料庫;4、輸入“update user set password=password(‘這裡是密碼,如:root’) where
1. mysql -h 127.0.0.1 的時候,使用TCP/IP串連, mysql server 認為該串連來自於127.0.0.1或者是"localhost.localdomain"2. mysql -h localhost 的時候,是不使用TCP/IP串連的,而使用Unix socket;此時,mysql server則認為該client是來自"localhost"3. mysql許可權管理中的"localhost"有特定含義:
把以下代碼儲存為phpinfo.php:<?phpphpinfo();?>mysql-------MySQL Support enabledActive Persistent Links 1Active Links 1Client API version 5.0.37-------如果看不到, 而且你確定資料庫已經安裝了, 那麼可能需要在伺服器中載入libmysql.dll:開啟httpd.conf (這個是Apache的設定檔),
要想匯入時避免不出現亂碼,只要保證資料檔案的編碼和匯入時甚至的編碼一直即可,注意:不是和資料庫的編碼一致。例如:資料檔案data.sql,編碼為UTF-8,使用如下命令: 代碼如下複製代碼 mysql -uroot -p --default-character-set=utf8 db < data.sql 上面的辦法不一定有效果,因為不知道mysql編碼,我們可以先查看mysql編碼 代碼如下複製代碼 mysql> show
代碼如下複製代碼 update comment set url=IF(url REGEXP 'test.yahoo.com.cn',REPLACE(url,'www1.www.111cn.net','www.sina.com'),REPLACE(url,'www2.yahoo.com','www.sina.com')) where 1=1;update comment set author_url=REPLACE(author_url,'hzhuti','sina')
1、登陸mysql資料庫 mysql -u root -p 查看user表 代碼如下複製代碼 mysql> use mysql;Database changedmysql> select host,user,password from user;+--------------+------+-------------------------------------------+|