LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mysql connection problem (https://www.linuxquestions.org/questions/linux-software-2/mysql-connection-problem-62820/)

ckamheng 05-31-2003 12:01 AM

mysql connection problem
 
hi every one , i have problem with mysql connection.
i try to connect like this
mysql -u root mysql
then i got connection error like this
Error 1045:access denied for user: 'root@localhost' (using password No)

I suspect it is my host name problem because i am still using localhost as my shell still prompt:
[root@localhost]#


Can anyone tell me how can i make a connection with mysql. My PC is connected to a LAN with dynamic IP address.
What is error 1045. Where can i check for this error.

My other linux box that is not connected to LAN works fine without error with host name localhost. ????
Thanks for your help.

eggers 05-31-2003 01:30 AM

Are you certain you have the user "root" defined for your mysql DB? I tried the following, and I think that may be your issue. Note your users for mysql and for your system are not related -- you need to create whatever users you need in mysql in addition to your OS users....

[root@monkey root]# mysql -u nugget mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
[root@monkey root]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 20 to server version: 3.23.41

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye
[root@monkey root]# mysql -u admin -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 3.23.41

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


All times are GMT -5. The time now is 11:59 AM.