日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

ubyntu 链接mysql_ubuntu mysql远程连接

發布時間:2024/7/5 数据库 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubyntu 链接mysql_ubuntu mysql远程连接 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ubuntu mysql遠程連接

http://blog.csdn.net/helen_shw/archive/2010/01/22/5224524.aspxkiki@kiki-desktop:/etc/apache2

mysql error number 2003

Can't connect to MySQL server xxx.xxx.xxx.xxx (10061)

在ubuntu 9.04中默認安裝了mysql,默認只能本地訪問,google了一下:

采用

登錄到MySQL服務器端,在mysql庫下執行

grant all on *.* to 'remote'@'172.16.21.39' identified by 'password';

即可

如果要設置為任何客戶端都可以以root連接的話,可以這么寫:

grant all on *.* to 'root'@'%' identifiied by 'root的密碼'

格式:grant select on 數據庫.* to 用戶名@登錄主機 identified by "密碼"

類似這用方法的整理如下:

1。?改表法。可能是你的帳號不允許從遠程登陸,只能在localhost。這個時候只要在localhost的那臺電腦,登入mysql后,更改?"mysql"?數據庫里的?"user"?表里的?"host"?項,從"localhost"改稱"%"

mysql?-u?root?-pvmwaremysql>use?mysql;mysql>update?user?set?host?=?'%'?where?user?=?'root';mysql>select?host,?user?from?user;

2.?授權法。例如,你想myuser使用mypassword從任何主機連接到mysql服務器的話。

GRANT?ALL?PRIVILEGES?ON?*.*?TO?'myuser'@'%'?IDENTIFIED?BY?'mypassword'?WITH?GRANT?OPTION;

如果你想允許用戶myuser從ip為192.168.1.3的主機連接到mysql服務器,并使用mypassword作為密碼

GRANT?ALL?PRIVILEGES?ON?*.*?TO?'myuser'@'192.168.1.3'?IDENTIFIED?BY?'mypassword'?WITH?GRANT?OPTION;

但問題仍沒有解決:

找到 命令?? mysql> flush privileges??? //使修改生效

顯示影響了零行。

問題依然沒有解決,重新啟動mysql? sudo /etc/init.d/mysql restart

還是不行。

從 http://www.blogjava.net/waterjava/archive/2008/04/27/196385.html

了解到mysql有本機綁定,找到問題所在。

編輯 /etc/mysql/my.cnf

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

bind-address = 127.0.0.1

將”bind-address = 127.0.0.1“注釋

sudo /etc/init.d/mysql restart重啟即可遠程訪問

問題解決

****************************************************************************************

root@kiki-desktop:/etc/apache2# apt-get install libapache2-mod-auth-mysql

apt-get install? lighttpd

apt-get install openssl

root@kiki-desktop:/etc/apache2# apt-get install libapache2-mod-gnutls

$ mysql -u root -p

mysql> use authz_db;

mysql> CREATE TABLE users(

-> user_name CHAR(30) NOT NULL,

-> user_passwd CHAR(20) NOT NULL,

-> PRIMARY KEY (user_name)

-> );

mysql> GRANT SELECT

-> ON authz_db.users

-> TO authuser@localhost

-> IDENTIFIED BY 'Your Password Here';

mysql> flush privileges;

mysql> INSERT INTO users VALUES('test',ENCRYPT('TEST'));

root@kiki-desktop:/etc/apache2# chkconfig --level 35 mysqld on

---------------------------------

如果要設置為任何客戶端都可以以root連接的話,可以這么寫:

grant all on *.* to 'root'@'%' identifiied by 'root的密碼'

進入mysql,

grant all on *.* to 'root'@'%' identifiied by 'root的密碼'

root@kiki-desktop:/etc/mysql# vim /etc/mysql/my.cnf

編輯 /etc/mysql/my.cnf

# Instead of skip-networking the default is now to listen only on

# localhost which is more compatible and is not less secure.

bind-address = 127.0.0.1

將”bind-address = 127.0.0.1“注釋

root@kiki-desktop:/etc/mysql# /etc/init.d/mysql restart

總結

以上是生活随笔為你收集整理的ubyntu 链接mysql_ubuntu mysql远程连接的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。