DIGIPOWER Tutorials

Trang chủ | | Danh mục bài viết yêu thích | Liên hệ | Đăng nhập Trang chủ | | Danh mục bài viết yêu thích | Liên hệ | Đăng nhập
Tìm kiếm các bài viết theo từ khoá Liệt kê theo danh mục
Thiếp lập remote MySQL trên DirectAdmin
Chi tiết bài viết

Lần cập nhật cuối
3rd of November, 2011

Ý kiến người dùng (69 Bình chọn)
65% thumbs up 34% thumbs down

Làm thế nào bạn sẽ đánh giá câu trả lời này?
có ích
không hữu ích
Note that the above guide will only grants da_admin on the "localhost", meaning you have to already be on that remote mysql server to use the account. We'll need to add another acccess hsot (ip) to allow the DA server to connect to it. Basically, you just run the "GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost" command again, but you change localhost to the IP of your DA server,

 GRANT ALL PRIVILEGES ON *.* TO da_admin@1.2.3.4 WITH GRANT OPTION;
FLUSH PRIVILEGES;

we don't need the "identified by 'pass'" again, because the password is already from adding it the first time.

At this point.. the remote mysql database should be setup and ready to accept DA to use it. Test it out by logging into your DA machine via ssh, and type:

 mysql -uda_admin -p --host=4.3.2.1

where 4.3.2.1 is the IP of your mysql server. If you can't connect, go back over your settings again.. also make sure that port 3306 is open on the remote box.

Now.. the easier part is to tell DA to use the remote server. Edit:
 /usr/local/directadmin/conf/mysql.conf

add the line:
 host=4.3.2.1

where 4.3.2.1 is the IP of your remote server. Make sure there is a newline character at the end of the line.. (Eg, press enter)

That should be it. Go into DA and check the mysql section of your user level to see if you get any errors. If not, try adding a database to make sure it works.

The only cleanup task would then be to fix up phpMyAdminto also connect to the remote host.
Edit /var/www/html/phpMyAdmin/config.inc.php
Find this line:

 $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address

and change it to
 $cfg['Servers'][$i]['host'] = '4.3.2.1'; // MySQL hostname or IP address

where 4.3.2.1 is the IP of your mysql server.
Các bài liên quan
File đính kèm
Không có File đính kèm nào được tìm thấy.

Tiếp tục

Knowledge Management