• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

MySQL - PHP

I am working on a project.  It requires me to connect to the MySQL server from the wamp.  I am not sure what I need to do get started with this process.  I was told that you can go to the MySQL server and create the database.  Well, I started with the command mysql -h localhost -u bparson -p.  I got this output.  

C:\Users\student>mysql -h localhost -u user -p
'mysql' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\student>mysql -h localhost -u bparson -p
'mysql' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\student>
0
assaultkitty
Asked:
assaultkitty
  • 6
  • 5
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
Open your browser and goto "http://localhost" and you should see the WAMP home page.  One of the links there is for 'phpmyadmin' which you can use to manage your MySQL.  MySQL under WAMP is not registered as a system program so I don't know if you can use the 'mysql' command line.
0
 
assaultkittyAuthor Commented:
DaveBaldwin,
At phpmyadmin, localhost@root is used to manage MySQL.  According to my book, I am to use the mysql command line.  
0
 
Dave BaldwinFixer of ProblemsCommented:
When you are using WAMP, the WAMP manager program runs MySQL, not Windows, so 'mysql' command is not on the path.  I suppose you could put it there.  On my copy of WAMP, I have go to the bin directory for the version of MySQL that is running which is "C:\wamp\bin\mysql\mysql5.1.36\bin" to run 'mysql' on the command line.  There I can use a user that has 'localhost' privileges to login.

Actually, it's root@localhost.  And if you run 'mysql' as above, you can login as 'root'.  I have set a password on my server so I have to use "mysql  -uroot -p".
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
assaultkittyAuthor Commented:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\student>C:\wamp\bin\mysql\mysql5.5.16\bin
'C:\wamp\bin\mysql\mysql5.5.16\bin' is not recognized as an internal or external
 command,
operable program or batch file.

C:\Users\student>

C:\Users\student>

C:\Users\student>

C:\Users\student>

This is what I got for my output.
0
 
Dave BaldwinFixer of ProblemsCommented:
No, you need to do "cd C:\wamp\bin\mysql\mysql5.5.16\bin" and then type 'mysql  -uroot -p'.  The 'mysql' program is not in the 'path' so you need to be in it's directory to run it.
0
 
assaultkittyAuthor Commented:
Thank you. Thank you.  I am happy.  One more question.  The mysql console.  Where does that come into play.  P.S. I do not need a password.
0
 
Dave BaldwinFixer of ProblemsCommented:
I don't know what you mean by "mysql console".  Using 'root' without a password is ok on a machine that no one else uses.  It can be critical on a machine that others have access to.
0
 
assaultkittyAuthor Commented:
the is a mysql console.  When you go to customize the wamp.  MySQL has a mysql console.  Where does that come into play?
0
 
Dave BaldwinFixer of ProblemsCommented:
That is just an alternate way to launch the 'mysql' command line program.
0
 
assaultkittyAuthor Commented:
Thanks.
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now