两台服务器,一个web服务,一个数据服务。
如何在web服务上实现连接数据服务上的mysql数据库?百度上搜索的看不懂。 请指教谢谢

解决方案 »

  1.   

    在MYSQL目录下
    D:\mysql6\bin>mysql -ucpc -p123 -P3306 -h218.26.42.69
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 8408
    Server version: 5.1.45-community-log MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>cpc是用户名称,123是密码,218.26.42.69是远端服务器的的IP地址,3306远端服务器的端口
      

  2.   

    D:\mysql6\bin>mysql -ucpc -p123 -P3306 -h218.26.42.69这个是在DOS下还是??? 我的是WIN2003系统 。感谢。
      

  3.   


    是的,在DOS窗口下。
    对应的参数改成你服务器的参数就可以了。
      

  4.   


    还是不行啊  报错:
    error 1045<80000>:access denied for user 'root'@'localhost'<using password:YES>
      

  5.   

    服务器没有给你开放权限。
    找服务器管理员,或者你自己到服务器上执行授权语句。
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123';这样就可以了。
      

  6.   

    error 1045<80000>:access denied for user 'root'@'localhost'<using password:YES>
    二哥,你不会把mysql -ucpc -p123 -P3306 -h218.26.42.69直接copy过去了吧,-p123表示密码是123,他们只是用这个举了个例子
      

  7.   


    不是直接COPY的呀。  是用自己的用户名和密码。
      

  8.   

    D:php\mysql5\bin>mysql -uroot -pchn_123 -P3306 -h211.*.*.*     //(正确的IP)
      

  9.   

    D:\php\mysql5\bin>mysql -uroot -pchn_123 -P3306 -h211.*.*.* 你确认下远端服务器的root用户是否允许你的IP进行访问。看看6楼的授权方法。