Unanswered: I cant connect to my db at my homemade server...
So.. I can´t connect to MySQL dbs...
I have installed MySQL on my winxp pro.
I putted the user name and password.
But when i try to use a script that uses mysql, just for test mysql... doesn´t work..
I dont know what to do.. this is the first time i run MySQL and the documentation is so extense. So i would like some few comments about how to start and use mysql in 10 minutes for example.. (dunno... im just wondering.. i think is possible).
Run the mysql monitor (command line) in a cmd window under win xp. The command c:\mysql\bin\mysql -u yourusername -p should do fine, as long as you actually set a username and password to use. Once in, you'll see a prompt like mysql> where you can type commands.
Try the command 'show databases;' (always follow a command with a semicolon.
Try choosing a database with the command 'use databasename;' (in this case, the test database is the default one to try).
Try listing the tables with the command 'show tables;'.
You can exit the mysql monitor with CTRL-D or just use the command 'quit'.
If you can get in with the mysql monitor, you can connect with PHP or whatever other method you use to connect.
Ok, so you can login to the MySQL monitor, successfully root around, view databases, etc, but you can't access via PHP? My guess is you have either a problem with your PHP config or with your script.
Example script that will work:
if (!$link = mysql_connect("localhost", "username", "password"))
die("Can't connect to database:<br>" . mysql_error());
Try that script, it will show you an error if it fails so have a tool to troubleshoot. Replace 'username' and 'password' with the appropriate entries, of course.
Oh, and by the way, setting up phpmysqladmin is no more difficult than placing the contents of the zip file in your webserver's document root, then editing the config.inc.php to add the absolute URL of the phpmysqladmin directory, your username and password. That's it.