Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am trying to use PHPmyadmin and have installed WAMP server, along with mySQL and have created some tables and databases using mysql command line... what happens is they do not show on phpmyadmin and neither can my php code access those database (the php code runs on the wamp).

i tried setting password to

root:127.0.0.1 and root:localhost

same password as that as for mysql root. What is more, when i create a database using phpmyadmin i can access that database using the php i wrote.

i am missing some thing? why cant my php code access the databases i created using mysql command line but can access those i created using phpmyadmin.

share|improve this question
try to post the code you use to connect to mysql, and what errors/messages/symptoms you see – Mathias R. Jessen Feb 26 '12 at 22:36
Separate issue: WAMP stacks are fairly awful performance-wise compared to a LAMP equivalent. Please reconsider using WAMP for a production application. – Joel E Salas Feb 27 '12 at 4:24

closed as off topic by SvW, Michael Hampton, Scott Pack, mulaz, HopelessN00b Oct 3 '12 at 23:57

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

you should post the connection error output you are getting, and relevant entries from the php_error file to get any sort of comprehensive answer.

You might also want to check the output of <?php phpinfo() ?>, that is check that it includes the php modules for mysql, however I would guess that is correct by default from the WAMP distribution settings.

if WAMP includes the php-cli command try something like this;

[root@server-45149 ~]# php -a
Interactive shell

php > mysql_connect("localhost","root","");
PHP Fatal error:  Call to undefined function mysql_connect() in php shell code on line 1

indicates that the php-mysql module is missing or not loaded.

and

[root@server-45149 ~]# php -a
Interactive shell

php > mysql_connect("localhost","root","") && print "success!";
success!

indicates that php can connect to mysql fine using those connection settings...

and paste the output....

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.