Jump to content


Photo

How To Connect Mysql Database


  • Please log in to reply
7 replies to this topic

#1 Karthik Kasi D

Karthik Kasi D

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 24 September 2008 - 06:43 AM

Hi I am using SQLYOG V7.02. Please guide me to connect the MYSQl database. My server Ip address is 192.9.200.13 and its port address is 400. I have entered 192.9.200.13 Ip address in the MYSQL Host address and username, password & port address 3306 in the new connection, but I am getting the Error message..

Error No. 1045

Access denied for user 'root' @ 'OPENWAVE4' (using Password: yes)

Please provide the solution to get connected with database.

#2 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,917 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 24 September 2008 - 07:52 AM

Please only post a question one place! I deleted the one one and will reply here!

Please read:
http://webyog.com/fa...ion-denied.html


Does the user have the right to connect from remote hosts? This is most likely the problem!
The error you get is an authentication error - not a connection error (it is the MySQL server that sends this meesage). So connection details are OK!
Computers make your grey hair come off ....

Peter Laursen
Webyog

#3 Karthik Kasi D

Karthik Kasi D

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 24 September 2008 - 09:06 AM

Thanks for ur reply, sorry for the repeated post. I can able to connect the database through PHPMYADMIN by using the following link..

http://192.9.200.116:400/phpmyadmin/

How can I overcome the connection error. Please give the steps.
How can I connect this through MYSQLYOG, Whether I need to change any of my server settings or .ini file settings.


Please only post a question one place! I deleted the one one and will reply here!

Please read:
http://webyog.com/fa...ion-denied.html


Does the user have the right to connect from remote hosts? This is most likely the problem!
The error you get is an authentication error - not a connection error (it is the MySQL server that sends this meesage). So connection details are OK!



#4 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,917 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 24 September 2008 - 12:48 PM

reference to phpMyAdmin is not relevant at all. PHP scripts (also phpMyAdmin) (practically always) connect to MySQL from 'localhost', because it is the webserver (like the Apache webserver wiht PHP system/module loaded) that connects to MySQL when connection is from a PHP script. With SQLyog (direct connection) you on the opposite connect from your local machine.

The users 'karthik'@'localhost', 'karthik'@'%' and 'karthik'@'some_ip_address' are 3 *different* users in MySQL and I bet that only 'karthik'@'localhost' (or 'karthik'@'127.0.0.1') exist at the moment. And that is the problem!

You will need to create a user that is allowed to connect from remote host(s). If your hosting does not allow for that you will need to use (HTTP or SSH) tunnelling. Those options are included with the ENTERPRISE version. But since you can connect (but not authenticate) that is likely not the problem.


Use your control panel application or commandline client on the server to create such user. Commandline syntax example

grant all on *.* to 'root'@'%' with grant option;

.. will create a 'root' user that can connect from everywhere and has same privileges as 'root'"localhost' (but I do not necessarily recommend such 'strong' user
privileges for remote users!).


Please read from the FAQ linked to above again:

* User is not allowed to connect from the actual host. Note that MySQL by default only allows connection from 'localhost'. To specify from where a user may connect SQL wildcards (% and _) can be used. Simply 'someuser@%' means that user 'someuser' may connect from everywhere.


Computers make your grey hair come off ....

Peter Laursen
Webyog

#5 Karthik Kasi D

Karthik Kasi D

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 24 September 2008 - 01:40 PM

I am not using remote server, it's a local server with windows XP OS which is located inside our office. The Ip address of my office local server 192.9.200.13 and my PC Ip address is 192.9.200.54. We are running all the PHP code from the local server, for running those PHP files we are using the URL http://192.9.200.13:400/projects

port 400 is assigned to run a php code and phpmyadmin. Please provide the steps to connect the local server database using MYSQLYog. Our server is running windows XP not the LINUX.


reference to phpMyAdmin is not relevant at all. PHP scripts (also phpMyAdmin) (practically always) connect to MySQL from 'localhost', because it is the webserver (like the Apache webserver wiht PHP system/module loaded) that connects to MySQL when connection is from a PHP script. With SQLyog (direct connection) you on the opposite connect from your local machine.

The users 'karthik'@'localhost', 'karthik'@'%' and 'karthik'@'some_ip_address' are 3 *different* users in MySQL and I bet that only 'karthik'@'localhost' (or 'karthik'@'127.0.0.1') exist at the moment. And that is the problem!

You will need to create a user that is allowed to connect from remote host(s). If your hosting does not allow for that you will need to use (HTTP or SSH) tunnelling. Those options are included with the ENTERPRISE version. But since you can connect (but not authenticate) that is likely not the problem.


Use your control panel application or commandline client on the server to create such user. Commandline syntax example

grant all on *.* to 'root'@'%' with grant option;

.. will create a 'root' user that can connect from everywhere and has same privileges as 'root'"localhost' (but I do not necessarily recommend such 'strong' user
privileges for remote users!).


Please read from the FAQ linked to above again:



#6 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,917 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 24 September 2008 - 03:28 PM

What you are writing does not change anything! You do not seem to be interested in understanding what I am writing!

Even if the machines involved are on a LAN a MySQL user must exist (in the mysql` database) with a host descriptoer (an ip or a name server alias) matching the machine where SQLyog is running.


Now if you connect with username 'me', could you try execute (from phpMyAdmin, command-line or whatever)

SELECT host, user FROM `mysql`.`user` WHERE user = 'me'
(substitute 'me')
Computers make your grey hair come off ....

Peter Laursen
Webyog

#7 PhilD

PhilD

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 September 2008 - 03:36 AM

I think your going about it the wrong way.

On the remote server (one you want to connect to) you must use your control panels mysql setup to add the ip address of your laptop (or computer you wish to use to connect to the remote database). In the add database user for a particular database there should be an access hosts section. You must set this up for each database you want to connect to remotely. If there is no access hosts field in the add user, ask your domains tech support if this is allowed and how to do it.

In sqlyog you would use the server your account is actually on.

MYSQL Host address: athena.medialayer.net
Username: username for_the_remote_database
password: password_for_above_user
use the correct port (it may not be 400) for the mysql database. Ask tech support for the info if necessary.


hope this helps some.

Phil

#8 peterlaursen

peterlaursen

    Advanced Member

  • Admin
  • PipPipPip
  • 7,917 posts
  • Gender:Male
  • Location:Skagen, Denmark
  • Interests:well ... jazz/folk music, photography, chess, nature, ecology, history, bicycling, Highland Malts ... well, Lowland Malts and Cognac too actually :-) just wonder how I get the time to touch a computer! SQLyog and MONyog? no that's not interest, that's BASIC NEEDS simply!

Posted 27 September 2008 - 08:20 AM

One more explanation then! This message

Access denied for user 'root' @ 'OPENWAVE4' (using Password: yes)



DOES NOT TELL that SQLyog tries to connect *to* the host 'OPENWAVE4'
BUT IT DOES TELL that the server does not allow 'root' user to connect *from* the host 'OPENWAVE4'.

It is the server that generates this message, not SQLyog.


You have to create user 'root' @ 'OPENWAVE4' (or 'root' @ '%') on the server. If you have access to command line client on the server (what I guess you have since this is happening on a LAN) use the GRANT statement (as 'root' @ 'localhost' - where (localhost' is the *server* host) like

GRANT ALL ON *.* TO 'root' @ '%' WITH GRANT OPTION;
(or better use a ip mask like 'root' @ 'ip1.ip2.ip3.%')

If not use what Control Panel application is available to create a user with remote access privilege.
Computers make your grey hair come off ....

Peter Laursen
Webyog




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users