Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database connection

Status
Not open for further replies.

nicasa

Programmer
Feb 3, 2003
54
ES
Hi there,

I have recently downloaded and installed mySQL, shareware version. I am new to databases ...
Q. Do I need to be connected to the internet to access the mySql server ?

I have used the WinMySQLadmin1.4.exe to create a user name and password and the green light shows.

local host name: MATTHEWS
local user name: steven

When I click on the mySql.exe to start a new database session I do seem able to connect. here are the messages that I get;-

mysql> connect

-- access denied for user ´@localhost´ to database steven

mysql> connect steven@MATTHEWS;

-- SAME MESSAGE



mysql> -u steven

-- no connection. Trying to reconnect.
ERROR: 1044: access denied for user ´@localhost´
ERROR: cannot connect to server

Q. Where is the server ? Is it remote, or already installed on my machine in the BIN folder ?

I am at my wits end, please help!


Thanks,

Steven Matthews
 
First, unless the MySQL server is on some other part of the internet, you don't have to be connected to the internet to access it.


The problem is likely how you created your user. MySQL user credentials are not only a 2-tuple of username and password. MySQL uses a 3-tuple of username, password, and IP address from which the user connects.

Unless you have told MySQL that your user can connect from localhost, even with the right username and password, you can't connect.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
By default, the only username defined in the database is root.
The username and password that is asked for the 1st time you run WinMySQLAdmin is only for that program.

I take it this installation is on Windows (Green Robot :))

The default install location is c:\MySQL
Your binaries will be in c:\MySQL\bin
Data files in ..\Data etc.

Add c:\mysql\bin to your path for easier access.
In a CMD Window, you can type "mysql -u root -p"
If your have not set up a password, just hit enter at the password prompt.
Then you can "SHOW DATABASES;" or "USE mysql;" etc...
 
Thankyou all for your efforts to help me.

I have followed all the advice given but still I cannot connect. I have even re-installed the software into the c:\mysql default folder !!

HEAR ARE MY DETAILS:
username: smatthews
localhostname: MATTHEWS-FAMILY
localusername: Steven


THis is what I now get:

mysql> create database learnsql;
ERROR 1044:access denied for user ´@localhost´ tp database learnsql.

mysql> -u smatthews;
No connection. trying to reconnect ...
ERROR 1044:access denied for user ´@localhost´ tp database learnsql.
Cannot connect to server

mysql> connect Steven@MATTHEWS-FAMILY;
ERROR 1044:access denied for user ´@localhost´ tp database learnsql.

HELP ........

I have spent so much time on something that should be so simple !!

Steven Matthews


 
Hi sleipnir214,

To invoke the mysql app I am double clicking on mysql.exe that comes with the shareware package ....

Steven Matthews
 
I am new too.:)(15 days)
try this dos prompt
mysql -u root

and this in mysql prompt
mysql>Use mysql;
mysql>GRANT ALL PRIVILEGES ON *.* TO Username@hostname;
above mean root will give your user name all Privileges Access(like Create,select) to your username@hostnamel;
after that you should have no problem when connect with your username@hostname to create Database.
mysql> exit;
then
mysql -h hostname -u username;


in Mysq
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top