Error with MySQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Hello PHP
Forum Newbie
Posts: 3
Joined: Thu Aug 22, 2002 5:27 am

Error with MySQL

Post by Hello PHP »

Hello I'm very new to PHP and MySQL.
I got first error with MYSQL when I tried to connected thought command prompt.
"ERROR 2003 : Can't connect to MySQL server on 'localhost' <10061>
After I run C:\mysql\bin\mysql in Command Prompt.
I running WinXP.
What I done wrong please help me :(
(sorry for mess up in other topic)
Hello PHP
Forum Newbie
Posts: 3
Joined: Thu Aug 22, 2002 5:27 am

Post by Hello PHP »

I don't know what's happend.
but seem that problem was gone.
but I got a new one.
mysql>CREATE TABLE tbl_gallery (
->iID INT(11) NOT NULL AUTO_INCREMENT,
->PRIMARY KEY (iID)
->);
ERROR 1046 : NO Database Selected
What I done wrong ? :?
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

You have to tell mysql which database to use, either when you login or once logged in.

When logging in at the command line

mysql -uUserName -pMyPassword db_name

or once logged in at the prompt

mysql>USE db_name
Hello PHP
Forum Newbie
Posts: 3
Joined: Thu Aug 22, 2002 5:27 am

Post by Hello PHP »

Thank you so much :D
I feel so ashamed for my stupid :oops:
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Hey, we all have to learn these things at some point. :)
Post Reply