LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL Connection (https://www.linuxquestions.org/questions/linux-software-2/mysql-connection-359347/)

DoobyWho 09-01-2005 10:07 PM

MySQL Connection
 
I'd like to connect to MySQL via MySQL Administrator and MySQL Query Browser.

I was getting an error that I was not allowed to access it - so I created an SSH tunnel with PuTTy and now my error was that localhost.localdomain could not access it.

I removed localhost.localdomain from the /etc/hosts file and now I am working fine.

Is it safe to remove localhost.localdomain from the /etc/hosts file? I've got plesk.

If not - how else should I enable this? I'd like to easily add certain users the ability to access remotely from certain IP addresses, but not all users or all IP's.

I know I can add the seperate IP's to mysql, however when I do that and connect with the mysql query browser, all users can see all databases. They can't connect to them - but they can see them listed.

Any better ways?

Thanks!

vtbludgeon 09-02-2005 09:24 AM

disclaimer: I'm no expert. that said,

Code:

cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain  [etc]

when I see something like that I usually assume they aren't kidding. HTH.

bigfez 09-02-2005 09:51 AM

double post, sorry.

bigfez 09-02-2005 09:57 AM

There is definitely something wrong if you need to delete localhost from /etc/hosts.

Can you connect to MySQL from command line?
ssh to the machine then
mysql -u root -p
then enter your password.
(If it's a new install you may not have a root password, fix that.)
Most likely you need to get in there and grant some permissions to specific users at specific hosts.

By default, MySQL creates a user who can connect without a username or password. but all they can do is view databases. It is usually a good idea to delete this user.

http://dev.mysql.com/doc/mysql/en/grant.html

DoobyWho 09-02-2005 01:28 PM

vtbludgeon - mine does not say that.

bigfez - yes i can connect via command line. the problem is with accepting external hosts. I can set mysql to allow certain hosts to connect w/ certain usernames, HOWEVER when they do that and they use mysql query browser they can view all other databases on the server. they cannot open them, but they can see they exist.

bigfez 09-02-2005 02:54 PM

What version of mysql are you using? I remember this used to be an issue with show databases a while back. I suppose if the GUI is simply retrieving the results of a show databases call it would exhibit the same behavior.

From the MySQL manual:

SHOW DATABASES lists the databases on the MySQL server host. You can also get this list using the mysqlshow command. As of MySQL 4.0.2, you see only those databases for which you have some kind of privilege, if you don't have the global SHOW DATABASES privilege.

http://dev.mysql.com/doc/mysql/en/show-databases.html


All times are GMT -5. The time now is 07:58 PM.