Re: [LHA-misc] mysql question ...
Status: Beta
Brought to you by:
ncherry
From: Mike B. <mi...@ba...> - 2001-05-29 14:13:14
|
Neil, MySQL grants access in various ways, by user, database, table, even field, and host. Most folks use User, Host, and DB restrictions. First, you have to have a user in table user of DB mysql. To test it, try 'mysql -u(userid) -p(password)' and see if you get in. Once you've done that, you need to ensure the DB you are trying to access allows access from localhost or whatever host you are comign from (see table hosts) Most MySQL installs will allow access to all DBs from localhost (not very secure) Finally, check the DB table to see if users can access the given DB - this is not always necessary since you can often use User & Host permissions, etc. A great tool for handling this (and tons of other LInux admin tasks) is Webmin - I highly recommend it (www.webmin.com I think) Its a browser based admin tool - even supports SSL connections and has modules for just about anything. Also, if you want a cool tool to maintain, view MySQL data, check out phpMyAdmin (http://www.phpwizard.net/projects/phpMyAdmin/) Awesome php tool for accessign MySQL DBs - I use it to maintain the dozen or so I have going here. As for setting up access - I generally setup a user with a hashed password (PASSWORD('the password here') when using an SQL UPDATE) and NO permissions. Setup the host perms to allow access from teh hosts you need (usually just localhost) Then in teh DB access table, grant the perms needed for hte given user. Mike Neil Cherry wrote: > I have access to the database working (almost!). I can access the database > via mysql if I'm 'root'. Of course this is bad and I've tried adding the > user X10 and LHAP but when I attempt to login both fail. Any ideas as to > how to get this to work with the new users. BTW, I've granted the user LHAP > access to the database for select only. > > |