Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old June 26th, 2008, 07:18 PM
Newbie
 
Join Date: Apr 2008
Posts: 23
Default Connect to MySQL database

This may seem REALLY obvious, but I am a beginner at MySQL and I have just created a new database in phpmyadmin. I have now opened up the mysql console in cmd, but how do I actually connect to the database. My server would just be localhost. I do not know the basic syntax to connect to a mysql database actually within the mysql cmd. The mysql cmd is the one where it looks like:

mysql>

Please help.
Reply
  #2  
Old June 27th, 2008, 06:58 AM
realin's Avatar
Familiar Sight
 
Join Date: Feb 2007
Age: 25
Posts: 252
Default

i dont understand why you need a console based interface when you got nice gui like PHPmyadmin and mysql query tools if u are a starter level user.
Anyways to connect to mysql thru command line, you path variable shoul be poiting towards bin directory, and if u dontknow how to do that then simply goto install directory and browse into bin folder. say

c:\mysql_install_die\bin

then in the command line write mysql -u username password
to change/select the schema/database write use schema_name
then ur queries ..

hope this helps
cheers !!
Reply
  #3  
Old June 27th, 2008, 06:37 PM
Newbie
 
Join Date: Apr 2008
Posts: 23
Default

Hi, can you give me an example of this please. I do not want to use phpmyadmin because I want to get used to the console.
Reply
  #4  
Old July 3rd, 2008, 06:55 AM
realin's Avatar
Familiar Sight
 
Join Date: Feb 2007
Age: 25
Posts: 252
Default

Quote:
Originally Posted by miraan
Hi, can you give me an example of this please. I do not want to use phpmyadmin because I want to get used to the console.
i have given u an example already.. please read the above reply
Reply
  #5  
Old July 3rd, 2008, 07:51 AM
Administrator
 
Join Date: Sep 2006
Posts: 11,441
Default

Quote:
Originally Posted by realin
...

then in the command line write mysql -u username password
...
Better make that

Expand|Select|Wrap|Line Numbers
  1. mysql -u username -p 
and then type the password when prompted.
<nitpicking>
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.