Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2004

    Unanswered: Connecting to mysql on a remote server


    I wonder if someone can help me. I have created a database on my local apache server and have now dumped the .sql file into my remote server. The local database has been successfully created as all the tables and data are visible - cool!

    However I have upload my new connection file with my database name, username, host name and password - which I have changed, and subseqently uploaded my files that interact with the database, I am getting a connection error.

    I am sure I have changed the connection details correctly and uploaded it to the correct file on the server.

    I really don't don't know where the problem is?

    Can anyone help, as it is a content management system that I am trying to get to work, and it is just wasting away, not being used because I cant connect to the remote database. It definately work on my local machine with the local connection setting?



  2. #2
    Join Date
    Jul 2004
    How are you trying to access the new database, via PHP?

    If so, here's a possible situation:

    You were running MySQL and PHP on the same server before, so privileges were granted in MySQL to as follows (example ID=fred):

    grant all on *.* to fred@localhost identified by wilma;

    This works fine when PHP and MySQL are running on the same box (localhost)

    But, if you switch your database to a new machine, fred is coming in from the machine where the PHP engine is running (example, it's called phpbox). You would have to set up MySQL priviliges as follows:

    grant all on *.* to fred@phpbox identified by wilma;

    Of course, if you're not using PHP in your scenario, ignore this post.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts