Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Jul 2011
    Posts
    11

    Unanswered: Unable to Connect to MySQL hosts

    I've been working on this for two weeks now. Microsoft won't allow phone support unless I sell my kidneys for both their programs I've downloaded to assist in web development (Visual Web Developer 2010 Express and WebMatrix) After opening either program I try to install the Wordpress Application and I get to the "Enter application information:" screen and enter the correct name's and password's to the never ending error message of:

    ----------------------------------------------------------
    The source is invalid.
    Cannot connect to the database".
    Cannot connect to the database".
    Unable to connect to any of the specified MySQL hosts
    ----------------------------------------------------------

    I am the administrator and I run the program as administrator on the pc. I have tried clean uninstall/reinstall. Tried opening the port 3306 for MySQL server. Nothing has worked. I really don't want to take this thing to a shop and would truly appreciate any help at all. Or at least a better forum to go to. I've tried plenty. Thank you very much.

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Where is MySQL database server installed? Is it on the same windows machine? The more information we get the more we will be able to help you.

    Just for your information there are two ways in which a client can talk with the MySQL server, through IP sockets and through shared memory on a Windows platform. So it might be that your installation only allows local access via shared memory which will require us to configure things in a different way.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    Jul 2011
    Posts
    11

    ok..

    Thank you very much for the quick reply. Yes, it is on the same machine with the server installed in C:/ProgramData/MySQL and the Connector Net in C:/ProgramFiles/MySQL. I am trying to develop the site on my server before paying to run the site live on a host server. Someone said it may have something to do with my User Account controls but I honestly have no idea. Again, I really do appreciate your help.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so if the server is on the same physical machine, which makes life a wee bit easier. Ive never had the need to install MySQL in shared memory, my installations have alwasy been IP based.

    so the first thing to do is to prove the server is actually alive
    try to find where the MySQL monitor executable (mysql.exe) and run it from that directory

    or if you are going to be creating your own data model for the site you will need some form of admin tool, personally I prefer MySQL workbench fromMySQL, but others are available such as HeidiSQL, PHPMyAdmin and so on.

    install one (or more ) of those tools and then wake it up, specifying your server location (either the same IP address as your server OR as localhost)

    if the tool cannot find the server then you have a bodged installation, it may also be a firewall issue although thats unlikely on the same physical machine.

    if the tools connection attempt is refused then its probably a rights issue, if so retry with the system admin account and password for the server (a default installation is I think root and a null / no password).

    once you have established a connection then make certain that you have GRANTed sufficient permissions for your website user to the website db. you should then make cerrtain you use the same userid, hostname and password when making your connection

    my guess is that your problem is going to be a rights issue.



    if you are using
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jul 2011
    Posts
    11

    update

    @healdem

    Ok I searched for the mysql.exe in my installed drive and came up with nothing. I couldn't find it searching through the server or connector net directories either. Although, in Administrative Tools>Services the MySQL51 status is "Started" Startup Type is "automatic" and the Log On As is "Local System" I don't know if that helps at all. Thank you very much for your help.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so thats suggesting that there is a valid MySQL instance active

    so now you need to work out what permissions have been granted to which user(s)
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Jul 2011
    Posts
    11

    user account

    @healdem

    Thank you. Ok my account is listed as Administrator under Control Panel > UserAccounts and I've also tried even opening WebMatrix and Visual Web Dev. and running as administrator and I still receive the error.

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have you actually tried to connect to MySQL using, say MySQL Workbench. totally outside of your development environment, so you knwo there is nothginbg screwing up the works

    as said before if you've proved MySQL is running, the next thing to do is to prove that some software can connect to the server. thats why personally I recommend that you use workbench as it also provides tools on administering the server, developing SQL and modelling tools. other suggest other tools such as HeidiSQL or phpMyAdmin.


    after that it comes down to making certain your development environment can talk to the server.

    if you installed your version of MySQL using say XAMPP then PHPMyAdmin should also have been loaded at the same time.
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    Join Date
    Jul 2011
    Posts
    11

    next

    @healdem

    Ok that sounds good. After downloading MySQL WB [http://wb.mysql.com/] I just run that program and it should open a connection with MySQL? I'm in the office now but will update you this evening asap [7pm US Central/12am GMT] You've been a whole lot of help.

  10. #10
    Join Date
    Jul 2011
    Posts
    11

    Update

    OK I managed to install and run MySQL WB remotely and on the opening screen under the "Open Connection to Starting Querying" on the left it shows..

    Local instance MySQL51
    [user: root host: localhost3306]

    Then under "Server Administration" on the right side it lists..

    LocalMySQL51
    [Local Type: Windows]

    So it seems my software is connecting in MySQL. Or am i wrong?

  11. #11
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    that shows that the MySQL server is active on the machine
    it proves that that server can accept connections

    so the next step is going to be working out why your applications co9nnection request is being refused

    as said befo9re Im pretty certain its going to be a user permissions problems
    ie the required permissions have not been GRANTed to that user
    that can be anyone of the following problems
    the user doesn't exist or doesn't have permissions for that DB
    there are inadeqaute permissions for that user
    there are no permissiuons for that user from that hostname

    all of theses can be diagnosed and fixed from workbench, which is why I suggested that you load workbench.

    As this is a development machine I'd suggest, to get you going, that you grant all permissions on the DB you are going to use for your website
    making certain that you grant those permissions to both the localhost AND the IP address of your workstation. afterwards you may need to flush privileges
    mysql workbench grant permissions - Google Search
    I'd rather be riding on the Tiger 800 or the Norton

  12. #12
    Join Date
    Jul 2011
    Posts
    11

    update

    Ok, that makes sense. Do I need the commandprompt for this, or is can I change permissions through settings or preferences in MySQL WB? I am going to get back with you this evening when I've got more time to work through it. Thanks again, and I'll keep you posted

  13. #13
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    as said in post # 11
    all of theses can be diagnosed and fixed from workbench, which is why I suggested that you load workbench.
    I'd rather be riding on the Tiger 800 or the Norton

  14. #14
    Join Date
    Jul 2011
    Posts
    11

    Still problems

    Ok I went into Manage Security on the right side of the home screen in workbench entered my server password and reached the Server Access Management (Pic 3) and Schema Privileges tabs. On the privileges tab there are grayed out Rights along the bottom (Pic 2) with the users to choose from I don't know if those have any affect. I marked the "DBA" Role at the top of the Administrative Roles Tab on the Server Access Management tab and it filled the checks below, after clicking apply it emptied the DBA box (Pic 1) closed out tried to installing WordPress app again and still receive the same exact error. I don't know if I should set a password on the Login tab or mess with the % Host settings. I appreciate any help.

    1. http://img220.imageshack.us/img220/3219/dba.png
    2. http://img546.imageshack.us/img546/551/schemaprivil.png
    3. http://img847.imageshack.us/img847/6...raccessman.png

  15. #15
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    seriously:- do not run applications with the root userID.. way to dangerous
    you should create userid(s) for the the application.
    you should then associate the required permissions to that user ID for that schema (database). the permissions should be the least required for that user (ie don't grant permissions that are not required for that role.
    you should also define an IP Address range and or host that that user is allowed to connect from.

    differnet people have different approaches but
    1) I'd change the root password so that it cannot be spoofed should you loose control of your PC. take note of that password and lock it away somewhere
    2) I'd create an Admin account for your normal use, this account should have all permissions for the application db, or if you prefer all permissions for all db's if you allow your DBA's access to all db's.. as a development environmnet probably all db's is a smart call. have one person per userid, and allow one person to say have multiple ID's if required say an admin account and a normal account). treat a web server as a separate user.
    3) I'd create a restricted account for each db thats is being accessed from a webserver (that account should allow for the basics eg selects, updates and deletes (assuming you allow deletes)
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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